devd.cc (152406) | devd.cc (152770) |
---|---|
1/*- 2 * Copyright (c) 2002-2003 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 --- 20 unchanged lines hidden (view full) --- 29 */ 30 31// TODO list: 32// o devd.conf and devd man pages need a lot of help: 33// - devd needs to document the unix domain socket 34// - devd.conf needs more details on the supported statements. 35 36#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2003 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 --- 20 unchanged lines hidden (view full) --- 29 */ 30 31// TODO list: 32// o devd.conf and devd man pages need a lot of help: 33// - devd needs to document the unix domain socket 34// - devd.conf needs more details on the supported statements. 35 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sbin/devd/devd.cc 152406 2005-11-14 02:01:10Z bland $"); | 37__FBSDID("$FreeBSD: head/sbin/devd/devd.cc 152770 2005-11-24 14:39:41Z jkoshy $"); |
38 39#include <sys/param.h> 40#include <sys/socket.h> 41#include <sys/stat.h> 42#include <sys/sysctl.h> 43#include <sys/types.h> 44#include <sys/un.h> 45 --- 32 unchanged lines hidden (view full) --- 78static const char attach = '+'; 79static const char detach = '-'; 80 81int Dflag; 82int dflag; 83int nflag; 84int romeo_must_die = 0; 85 | 38 39#include <sys/param.h> 40#include <sys/socket.h> 41#include <sys/stat.h> 42#include <sys/sysctl.h> 43#include <sys/types.h> 44#include <sys/un.h> 45 --- 32 unchanged lines hidden (view full) --- 78static const char attach = '+'; 79static const char detach = '-'; 80 81int Dflag; 82int dflag; 83int nflag; 84int romeo_must_die = 0; 85 |
86static const char *configfile = CF; 87 |
|
86static void event_loop(void); 87static void usage(void); 88 89template <class T> void 90delete_and_clear(vector<T *> &v) 91{ 92 typename vector<T *>::const_iterator i; 93 --- 254 unchanged lines hidden (view full) --- 348 sort(v.begin(), v.end(), epv_greater()); 349} 350 351void 352config::parse(void) 353{ 354 vector<string>::const_iterator i; 355 | 88static void event_loop(void); 89static void usage(void); 90 91template <class T> void 92delete_and_clear(vector<T *> &v) 93{ 94 typename vector<T *>::const_iterator i; 95 --- 254 unchanged lines hidden (view full) --- 350 sort(v.begin(), v.end(), epv_greater()); 351} 352 353void 354config::parse(void) 355{ 356 vector<string>::const_iterator i; 357 |
356 parse_one_file(CF); | 358 parse_one_file(configfile); |
357 for (i = _dir_list.begin(); i != _dir_list.end(); i++) 358 parse_files_in_dir((*i).c_str()); 359 sort_vector(_attach_list); 360 sort_vector(_detach_list); 361 sort_vector(_nomatch_list); 362 sort_vector(_notify_list); 363} 364 --- 538 unchanged lines hidden (view full) --- 903 * main 904 */ 905int 906main(int argc, char **argv) 907{ 908 int ch; 909 910 check_devd_enabled(); | 359 for (i = _dir_list.begin(); i != _dir_list.end(); i++) 360 parse_files_in_dir((*i).c_str()); 361 sort_vector(_attach_list); 362 sort_vector(_detach_list); 363 sort_vector(_nomatch_list); 364 sort_vector(_notify_list); 365} 366 --- 538 unchanged lines hidden (view full) --- 905 * main 906 */ 907int 908main(int argc, char **argv) 909{ 910 int ch; 911 912 check_devd_enabled(); |
911 while ((ch = getopt(argc, argv, "Ddn")) != -1) { | 913 while ((ch = getopt(argc, argv, "Ddf:n")) != -1) { |
912 switch (ch) { 913 case 'D': 914 Dflag++; 915 break; 916 case 'd': 917 dflag++; 918 break; | 914 switch (ch) { 915 case 'D': 916 Dflag++; 917 break; 918 case 'd': 919 dflag++; 920 break; |
921 case 'f': 922 configfile = optarg; 923 break; |
|
919 case 'n': 920 nflag++; 921 break; 922 default: 923 usage(); 924 } 925 } 926 --- 12 unchanged lines hidden --- | 924 case 'n': 925 nflag++; 926 break; 927 default: 928 usage(); 929 } 930 } 931 --- 12 unchanged lines hidden --- |