Author: eadler Date: Sun Jul 29 21:00:18 2018 New Revision: 336877 URL: https://svnweb.freebsd.org/changeset/base/336877
Log: Revert "devd: use C++ style casts" It seems that nullptr is not yet supported by all compilers used by FreeBSD. :( Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Sun Jul 29 20:47:00 2018 (r336876) +++ head/sbin/devd/devd.cc Sun Jul 29 21:00:18 2018 (r336877) @@ -262,12 +262,12 @@ my_system(const char *command) */ cfg.close_pidfile(); ::closefrom(3); - ::execl(_PATH_BSHELL, "sh", "-c", command, nullptr); + ::execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL); ::_exit(127); default: /* parent */ savedpid = pid; do { - pid = ::wait4(savedpid, &pstat, 0, nullptr); + pid = ::wait4(savedpid, &pstat, 0, (struct rusage *)0); } while (pid == -1 && errno == EINTR); break; } @@ -374,7 +374,7 @@ media::do_match(config &c) memset(&ifmr, 0, sizeof(ifmr)); strlcpy(ifmr.ifm_name, value.c_str(), sizeof(ifmr.ifm_name)); - if (ioctl(s, SIOCGIFMEDIA, &ifmr) >= 0 && + if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0 && ifmr.ifm_status & IFM_AVALID) { devdlog(LOG_DEBUG, "%s has media type 0x%x\n", value.c_str(), IFM_TYPE(ifmr.ifm_active)); @@ -527,7 +527,7 @@ config::open_pidfile() pfh = pidfile_open(_pidfile.c_str(), 0600, &otherpid); if (pfh == NULL) { if (errno == EEXIST) - errx(1, "devd already running, pid: %d", static_cast<int>(otherpid)); + errx(1, "devd already running, pid: %d", (int)otherpid); warn("cannot open pid file"); } } @@ -854,7 +854,7 @@ process_event(char *buffer) // Save the time this happened (as approximated by when we got // around to processing it). gettimeofday(&tv, NULL); - asprintf(×tr, "%jd.%06ld", static_cast<uintmax_t>(tv.tv_sec), tv.tv_usec); + asprintf(×tr, "%jd.%06ld", (uintmax_t)tv.tv_sec, tv.tv_usec); cfg.set_variable("timestamp", timestr); free(timestr); @@ -919,7 +919,7 @@ create_socket(const char *name, int socktype) unlink(name); if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) err(1, "fcntl"); - if (::bind(fd, reinterpret_cast<struct sockaddr *>(&sun), slen) < 0) + if (::bind(fd, (struct sockaddr *) & sun, slen) < 0) err(1, "bind"); listen(fd, 4); if (chown(name, 0, 0)) /* XXX - root.wheel */ _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"