devd.cc (114541) | devd.cc (117246) |
---|---|
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.conf needs to lose the warning about zone files. 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.conf needs to lose the warning about zone files. 34// - devd.conf needs more details on the supported statements. 35 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sbin/devd/devd.cc 114541 2003-05-02 17:38:08Z imp $"); | 37__FBSDID("$FreeBSD: head/sbin/devd/devd.cc 117246 2003-07-05 00:43:50Z imp $"); |
38 39#include <sys/param.h> 40#include <sys/types.h> 41#include <sys/sysctl.h> 42 43#include <ctype.h> 44#include <dirent.h> 45#include <errno.h> --- 545 unchanged lines hidden (view full) --- 591 rv = select(fd + 1, &fds, &fds, &fds, &tv); 592 // No events -> we've processed all pending events 593 // == 2 is a kernel bug, but we hang if we don't 594 // make allowances for a while. 595 if (rv == 0 || rv == 2) { 596 if (Dflag) 597 fprintf(stderr, "Calling daemon\n"); 598 daemon(0, 0); | 38 39#include <sys/param.h> 40#include <sys/types.h> 41#include <sys/sysctl.h> 42 43#include <ctype.h> 44#include <dirent.h> 45#include <errno.h> --- 545 unchanged lines hidden (view full) --- 591 rv = select(fd + 1, &fds, &fds, &fds, &tv); 592 // No events -> we've processed all pending events 593 // == 2 is a kernel bug, but we hang if we don't 594 // make allowances for a while. 595 if (rv == 0 || rv == 2) { 596 if (Dflag) 597 fprintf(stderr, "Calling daemon\n"); 598 daemon(0, 0); |
599 cfg.drop_pidfile(); |
|
599 once++; 600 } 601 } 602 rv = read(fd, buffer, sizeof(buffer) - 1); 603 if (rv > 0) { 604 buffer[rv] = '\0'; 605 while (buffer[--rv] == '\n') 606 buffer[rv] = '\0'; --- 131 unchanged lines hidden (view full) --- 738 nflag++; 739 break; 740 default: 741 usage(); 742 } 743 } 744 745 cfg.parse(); | 600 once++; 601 } 602 } 603 rv = read(fd, buffer, sizeof(buffer) - 1); 604 if (rv > 0) { 605 buffer[rv] = '\0'; 606 while (buffer[--rv] == '\n') 607 buffer[rv] = '\0'; --- 131 unchanged lines hidden (view full) --- 739 nflag++; 740 break; 741 default: 742 usage(); 743 } 744 } 745 746 cfg.parse(); |
746 if (!dflag && nflag) | 747 if (!dflag && nflag) { |
747 daemon(0, 0); | 748 daemon(0, 0); |
748 cfg.drop_pidfile(); | 749 cfg.drop_pidfile(); 750 } |
749 signal(SIGHUP, gensighand); 750 signal(SIGINT, gensighand); 751 signal(SIGTERM, gensighand); 752 event_loop(); 753 return (0); 754} | 751 signal(SIGHUP, gensighand); 752 signal(SIGINT, gensighand); 753 signal(SIGTERM, gensighand); 754 event_loop(); 755 return (0); 756} |