Deleted Added
full compact
devd.cc (247755) devd.cc (247756)
1/*-
2 * Copyright (c) 2002-2010 M. Warner Losh.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 49 unchanged lines hidden (view full) ---

58 */
59
60// TODO list:
61// o devd.conf and devd man pages need a lot of help:
62// - devd needs to document the unix domain socket
63// - devd.conf needs more details on the supported statements.
64
65#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002-2010 M. Warner Losh.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 49 unchanged lines hidden (view full) ---

58 */
59
60// TODO list:
61// o devd.conf and devd man pages need a lot of help:
62// - devd needs to document the unix domain socket
63// - devd.conf needs more details on the supported statements.
64
65#include <sys/cdefs.h>
66__FBSDID("$FreeBSD: head/sbin/devd/devd.cc 247755 2013-03-04 02:21:12Z eadler $");
66__FBSDID("$FreeBSD: head/sbin/devd/devd.cc 247756 2013-03-04 02:21:15Z eadler $");
67
68#include <sys/param.h>
69#include <sys/socket.h>
70#include <sys/stat.h>
71#include <sys/sysctl.h>
72#include <sys/types.h>
73#include <sys/wait.h>
74#include <sys/un.h>

--- 832 unchanged lines hidden (view full) ---

907 fd_set fds;
908
909 fd = open(PATH_DEVCTL, O_RDONLY | O_CLOEXEC);
910 if (fd == -1)
911 err(1, "Can't open devctl device %s", PATH_DEVCTL);
912 server_fd = create_socket(PIPE);
913 accepting = 1;
914 max_fd = max(fd, server_fd) + 1;
67
68#include <sys/param.h>
69#include <sys/socket.h>
70#include <sys/stat.h>
71#include <sys/sysctl.h>
72#include <sys/types.h>
73#include <sys/wait.h>
74#include <sys/un.h>

--- 832 unchanged lines hidden (view full) ---

907 fd_set fds;
908
909 fd = open(PATH_DEVCTL, O_RDONLY | O_CLOEXEC);
910 if (fd == -1)
911 err(1, "Can't open devctl device %s", PATH_DEVCTL);
912 server_fd = create_socket(PIPE);
913 accepting = 1;
914 max_fd = max(fd, server_fd) + 1;
915 while (1) {
916 if (romeo_must_die)
917 break;
915 while (!romeo_must_die) {
918 if (!once && !dflag && !nflag) {
919 // Check to see if we have any events pending.
920 tv.tv_sec = 0;
921 tv.tv_usec = 0;
922 FD_ZERO(&fds);
923 FD_SET(fd, &fds);
924 rv = select(fd + 1, &fds, &fds, &fds, &tv);
925 // No events -> we've processed all pending events

--- 224 unchanged lines hidden ---
916 if (!once && !dflag && !nflag) {
917 // Check to see if we have any events pending.
918 tv.tv_sec = 0;
919 tv.tv_usec = 0;
920 FD_ZERO(&fds);
921 FD_SET(fd, &fds);
922 rv = select(fd + 1, &fds, &fds, &fds, &tv);
923 // No events -> we've processed all pending events

--- 224 unchanged lines hidden ---