From owner-p4-projects@FreeBSD.ORG Fri Jun 30 13:40:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A108716A567; Fri, 30 Jun 2006 13:40:38 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3886416A555 for ; Fri, 30 Jun 2006 13:40:38 +0000 (UTC) (envelope-from bushman@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3FAF94486C for ; Fri, 30 Jun 2006 13:22:09 +0000 (GMT) (envelope-from bushman@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5UDM9Tn043467 for ; Fri, 30 Jun 2006 13:22:09 GMT (envelope-from bushman@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5UDM81I043464 for perforce@freebsd.org; Fri, 30 Jun 2006 13:22:08 GMT (envelope-from bushman@freebsd.org) Date: Fri, 30 Jun 2006 13:22:08 GMT Message-Id: <200606301322.k5UDM81I043464@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bushman@freebsd.org using -f From: Michael Bushkov To: Perforce Change Reviews Cc: Subject: PERFORCE change 100350 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2006 13:40:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=100350 Change 100350 by bushman@bushman_nss_ldap_cached on 2006/06/30 13:21:13 IFC Affected files ... .. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/stdlib/tsearch.3#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/gen/Makefile#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/gen/test-fpclassify.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/gen/test-wordexp.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/Makefile#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-btowc.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-btowc.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-iswctype.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-iswctype.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mblen.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mblen.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbrlen.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbrlen.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbrtowc.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbrtowc.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbsnrtowcs.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbsnrtowcs.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbsrtowcs.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbsrtowcs.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbstowcs.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbstowcs.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbtowc.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-mbtowc.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-towctrans.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-towctrans.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-wcrtomb.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-wcrtomb.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-wcsnrtombs.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-wcsnrtombs.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-wcsrtombs.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-wcsrtombs.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-wcstombs.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-wcstombs.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-wctomb.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/locale/test-wctomb.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/net/Makefile#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/net/test-eui64.h#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/net/test-eui64_aton.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/net/test-eui64_aton.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/net/test-eui64_line.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/net/test-eui64_line.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/net/test-eui64_ntoa.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/net/test-eui64_ntoa.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/regex/Makefile#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/resolv/Makefile#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/resolv/mach#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/resolv/resolv.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/resolv/resolv.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdio/Makefile#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdio/test-perror.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdio/test-perror.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdio/test-printfloat.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdio/test-printfloat.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdio/test-scanfloat.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdio/test-scanfloat.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdlib/Makefile#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdlib/test-heapsort.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdlib/test-heapsort.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdlib/test-mergesort.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdlib/test-mergesort.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdlib/test-qsort.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdlib/test-qsort.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/stdlib/test-sort.h#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/string/Makefile#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/string/test-strerror.c#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/string/test-strerror.t#1 branch .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/kgmon/kgmon.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/newsyslog/newsyslog.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/config.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/connect.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/debug.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/list.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/main.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/mkpeer.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/msg.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/name.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/rmhook.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/show.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/shutdown.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/status.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/types.c#2 integrate .. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/write.c#2 integrate Differences ... ==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/stdlib/tsearch.3#2 (text+ko) ==== @@ -25,7 +25,7 @@ .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" OpenBSD: tsearch.3,v 1.2 1998/06/21 22:13:49 millert Exp -.\" $FreeBSD: src/lib/libc/stdlib/tsearch.3,v 1.14 2005/01/20 09:17:04 ru Exp $ +.\" $FreeBSD: src/lib/libc/stdlib/tsearch.3,v 1.15 2006/06/23 13:36:33 keramida Exp $ .\" .Dd June 15, 1997 .Dt TSEARCH 3 @@ -42,7 +42,7 @@ .Ft void * .Fn tsearch "const void *key" "void **rootp" "int (*compar) (const void *, const void *)" .Ft void -.Fn twalk "const void *root" "void (*compar) (const void *, VISIT, int)" +.Fn twalk "const void *root" "void (*action) (const void *, VISIT, int)" .Sh DESCRIPTION The .Fn tdelete , ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/kgmon/kgmon.c#2 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)kgmon.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$FreeBSD: src/usr.sbin/kgmon/kgmon.c,v 1.14 2004/08/30 03:11:46 marcel Exp $"; + "$FreeBSD: src/usr.sbin/kgmon/kgmon.c,v 1.15 2006/06/29 09:18:16 delphij Exp $"; #endif /* not lint */ #include @@ -178,7 +178,7 @@ } /* - * Check that profiling is enabled and open any ncessary files. + * Check that profiling is enabled and open any necessary files. */ int openfiles(system, kmemf, kvp) ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/newsyslog/newsyslog.c#2 (text+ko) ==== @@ -54,7 +54,7 @@ */ #include -__FBSDID("$FreeBSD: src/usr.sbin/newsyslog/newsyslog.c,v 1.103 2006/01/20 05:18:01 gad Exp $"); +__FBSDID("$FreeBSD: src/usr.sbin/newsyslog/newsyslog.c,v 1.105 2006/06/27 22:14:09 gad Exp $"); #define OSF #ifndef COMPRESS_POSTFIX @@ -88,12 +88,6 @@ #include "pathnames.h" #include "extern.h" -/* Define this symbol to try out the "new order" for work items. */ -#define TRY_NEWORDER -#ifndef USE_NEWORDER -#define USE_NEWORDER 1 /* Initial value for dbg_new_order */ -#endif - /* * Bit-values for the 'flags' parsed from a config-file entry. */ @@ -165,12 +159,6 @@ SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); int dbg_at_times; /* -D Show details of 'trim_at' code */ -/* - * The debug options "neworder" and "oldorder" can be used to change - * which order work is done in. Note that both options will disappear - * in the near future, and the "new" order will be the only order. - */ -int dbg_new_order = USE_NEWORDER; int archtodir = 0; /* Archive old logfiles to other directory */ int createlogs; /* Create (non-GLOB) logfiles which do not */ @@ -194,9 +182,10 @@ struct ptime_data *dbg_timenow; /* A "timenow" value set via -D option */ struct ptime_data *timenow; /* The time to use for checking at-fields */ +#define DAYTIME_LEN 16 +char daytime[DAYTIME_LEN]; /* The current time in human readable form, + * used for rotation-tracking messages. */ char hostname[MAXHOSTNAMELEN]; /* hostname */ -char daytime[16]; /* The current time in human readable form, - * used for rotation-tracking messages. */ static struct conf_entry *get_worklist(char **files); static void parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, @@ -208,7 +197,6 @@ static void change_attrs(const char *, const struct conf_entry *); static fk_entry do_entry(struct conf_entry *); static fk_entry do_rotate(const struct conf_entry *); -#ifdef TRY_NEWORDER static void do_sigwork(struct sigwork_entry *); static void do_zipwork(struct zipwork_entry *); static struct sigwork_entry * @@ -217,7 +205,6 @@ save_zipwork(const struct conf_entry *, const struct sigwork_entry *, int, const char *); static void set_swpid(struct sigwork_entry *, const struct conf_entry *); -#endif static int sizefile(const char *); static void expand_globs(struct conf_entry **work_p, struct conf_entry **glob_p); @@ -229,10 +216,7 @@ static int parse_doption(const char *doption); static void usage(void); static int log_trim(const char *logname, const struct conf_entry *log_ent); -static void compress_log(char *logname, int dowait); -static void bzcompress_log(char *logname, int dowait); static int age_old_log(char *file); -static int send_signal(const struct conf_entry *ent); static void savelog(char *from, char *to); static void createdir(const struct conf_entry *ent, char *dirpart); static void createlog(const struct conf_entry *ent); @@ -252,10 +236,8 @@ { fk_entry free_or_keep; struct conf_entry *p, *q; -#ifdef TRY_NEWORDER struct sigwork_entry *stmp; struct zipwork_entry *ztmp; -#endif SLIST_INIT(&swhead); SLIST_INIT(&zwhead); @@ -280,7 +262,6 @@ q = p; } -#ifdef TRY_NEWORDER /* * Send signals to any processes which need a signal to tell * them to close and re-open the log file(s) we have rotated. @@ -322,7 +303,6 @@ SLIST_REMOVE_HEAD(&swhead, sw_nextp); free(stmp); } -#endif /* TRY_NEWORDER */ while (wait(NULL) > 0 || errno == EINTR) ; @@ -476,9 +456,9 @@ else if ((ent->flags & CE_CREATE) && createlogs) ent->firstcreate = 1; else if (ent->flags & CE_CREATE) - strncpy(temp_reason, " (no -C option)", REASON_MAX); + strlcpy(temp_reason, " (no -C option)", REASON_MAX); else if (createlogs) - strncpy(temp_reason, " (no C flag)", REASON_MAX); + strlcpy(temp_reason, " (no C flag)", REASON_MAX); if (ent->firstcreate) { if (verbose) @@ -584,102 +564,6 @@ #undef REASON_MAX } -/* Send a signal to the pid specified by pidfile */ -static int -send_signal(const struct conf_entry *ent) -{ - pid_t target_pid; - int did_notify; - FILE *f; - long minok, maxok, rval; - const char *target_name; - char *endp, *linep, line[BUFSIZ]; - - did_notify = 0; - f = fopen(ent->pid_file, "r"); - if (f == NULL) { - warn("can't open pid file: %s", ent->pid_file); - return (did_notify); - /* NOTREACHED */ - } - - if (fgets(line, BUFSIZ, f) == NULL) { - /* - * XXX - If the pid file is empty, is that really a - * problem? Wouldn't that mean that the process - * has shut down? In that case there would be no - * problem with compressing the rotated log file. - */ - if (feof(f)) - warnx("pid file is empty: %s", ent->pid_file); - else - warn("can't read from pid file: %s", ent->pid_file); - (void) fclose(f); - return (did_notify); - /* NOTREACHED */ - } - (void) fclose(f); - - target_name = "daemon"; - minok = MIN_PID; - maxok = MAX_PID; - if (ent->flags & CE_SIGNALGROUP) { - /* - * If we are expected to signal a process-group when - * rotating this logfile, then the value read in should - * be the negative of a valid process ID. - */ - target_name = "process-group"; - minok = -MAX_PID; - maxok = -MIN_PID; - } - - errno = 0; - linep = line; - while (*linep == ' ') - linep++; - rval = strtol(linep, &endp, 10); - if (*endp != '\0' && !isspacech(*endp)) { - warnx("pid file does not start with a valid number: %s", - ent->pid_file); - rval = 0; - } else if (rval < minok || rval > maxok) { - warnx("bad value '%ld' for process number in %s", - rval, ent->pid_file); - if (verbose) - warnx("\t(expecting value between %ld and %ld)", - minok, maxok); - rval = 0; - } - if (rval == 0) { - return (did_notify); - /* NOTREACHED */ - } - - target_pid = rval; - - if (noaction) { - did_notify = 1; - printf("\tkill -%d %d\n", ent->sig, (int) target_pid); - } else if (kill(target_pid, ent->sig)) { - /* - * XXX - Iff the error was "no such process", should that - * really be an error for us? Perhaps the process - * is already gone, in which case there would be no - * problem with compressing the rotated log file. - */ - warn("can't notify %s, pid %d", target_name, - (int) target_pid); - } else { - did_notify = 1; - if (verbose) - printf("%s pid %d notified\n", target_name, - (int) target_pid); - } - - return (did_notify); -} - static void parse_args(int argc, char **argv) { @@ -688,8 +572,7 @@ timenow = ptime_init(NULL); ptimeset_time(timenow, time(NULL)); - (void)strncpy(daytime, ptimeget_ctime(timenow) + 4, 15); - daytime[15] = '\0'; + strlcpy(daytime, ptimeget_ctime(timenow) + 4, DAYTIME_LEN); /* Let's get our hostname */ (void)gethostname(hostname, sizeof(hostname)); @@ -822,20 +705,10 @@ return (1); /* successfully parsed */ } - if (strcmp(doption, "neworder") == 0) { -#ifdef TRY_NEWORDER - dbg_new_order++; -#else - warnx("NOTE: The code for 'neworder' was not compiled in."); -#endif - return (1); /* successfully parsed */ - } - if (strcmp(doption, "oldorder") == 0) { -#ifdef TRY_NEWORDER - dbg_new_order = 0; -#else - warnx("NOTE: The code for 'neworder' was not compiled in."); -#endif + /* XXX - This check could probably be dropped. */ + if ((strcmp(doption, "neworder") == 0) || (strcmp(doption, "oldorder") + == 0)) { + warnx("NOTE: newsyslog always uses 'neworder'."); return (1); /* successfully parsed */ } @@ -1485,8 +1358,9 @@ char file1[MAXPATHLEN], file2[MAXPATHLEN]; char zfile1[MAXPATHLEN], zfile2[MAXPATHLEN]; char jfile1[MAXPATHLEN]; - int flags, notified, need_notification, numlogs_c; + int flags, numlogs_c; fk_entry free_or_keep; + struct sigwork_entry *swork; struct stat st; flags = ent->flags; @@ -1612,90 +1486,27 @@ printf("Start new log...\n"); createlog(ent); -#ifdef TRY_NEWORDER /* * Save all signalling and file-compression to be done after log * files from all entries have been rotated. This way any one * process will not be sent the same signal multiple times when * multiple log files had to be rotated. */ - if (dbg_new_order) { - struct sigwork_entry *swork; - - swork = NULL; - if (ent->pid_file != NULL) - swork = save_sigwork(ent); - if (ent->numlogs > 0 && (flags & (CE_COMPACT | CE_BZCOMPACT))) { - /* - * The zipwork_entry will include a pointer to this - * conf_entry, so the conf_entry should not be freed. - */ - free_or_keep = KEEP_ENT; - save_zipwork(ent, swork, ent->fsize, file1); - } - return (free_or_keep); + swork = NULL; + if (ent->pid_file != NULL) + swork = save_sigwork(ent); + if (ent->numlogs > 0 && (flags & (CE_COMPACT | CE_BZCOMPACT))) { + /* + * The zipwork_entry will include a pointer to this + * conf_entry, so the conf_entry should not be freed. + */ + free_or_keep = KEEP_ENT; + save_zipwork(ent, swork, ent->fsize, file1); } -#endif /* TRY_NEWORDER */ - /* - * Find out if there is a process to signal. If nosignal (-s) was - * specified, then do not signal any process. Note that nosignal - * will trigger a warning message if the rotated logfile needs to - * be compressed, *unless* -R was specified. This is because there - * presumably still are process(es) writing to the old logfile, but - * we assume that a -sR request comes from a process which writes - * to the logfile, and as such, that process has already made sure - * that the logfile is not presently in use. - */ - need_notification = notified = 0; - if (ent->pid_file != NULL) { - need_notification = 1; - if (!nosignal) - notified = send_signal(ent); /* the normal case! */ - else if (rotatereq) - need_notification = 0; - } - - if ((flags & CE_COMPACT) || (flags & CE_BZCOMPACT)) { - if (need_notification && !notified) - warnx( - "log %s.0 not compressed because daemon(s) not notified", - ent->log); - else if (noaction) { - printf("\tsleep 10\n"); - if (flags & CE_COMPACT) - printf("\tgzip %s.0\n", ent->log); - else - printf("\tbzip2 %s.0\n", ent->log); - } else { - if (notified) { - if (verbose) - printf("small pause to allow daemon(s) to close log\n"); - sleep(10); - } - if (archtodir) { - (void) snprintf(file1, sizeof(file1), "%s/%s", - dirpart, namepart); - if (flags & CE_COMPACT) - compress_log(file1, - flags & CE_COMPACTWAIT); - else if (flags & CE_BZCOMPACT) - bzcompress_log(file1, - flags & CE_COMPACTWAIT); - } else { - if (flags & CE_COMPACT) - compress_log(ent->log, - flags & CE_COMPACTWAIT); - else if (flags & CE_BZCOMPACT) - bzcompress_log(ent->log, - flags & CE_COMPACTWAIT); - } - } - } return (free_or_keep); } -#ifdef TRY_NEWORDER static void do_sigwork(struct sigwork_entry *swork) { @@ -2011,7 +1822,6 @@ return; } -#endif /* TRY_NEWORDER */ /* Log the fact that the logs were turned over */ static int @@ -2039,50 +1849,6 @@ return (0); } -/* - * XXX - Note that both compress_log and bzcompress_log will lose the - * NODUMP flag if it was set on somelog.0. Fixing that in newsyslog - * (as opposed to fixing gzip/bzip2) will require some restructuring - * of the code. That restructuring is planned for a later update... - */ -/* Fork of gzip to compress the old log file */ -static void -compress_log(char *logname, int dowait) -{ - pid_t pid; - char tmp[MAXPATHLEN]; - - while (dowait && (wait(NULL) > 0 || errno == EINTR)) - ; - (void) snprintf(tmp, sizeof(tmp), "%s.0", logname); - pid = fork(); - if (pid < 0) - err(1, "gzip fork"); - else if (!pid) { - (void) execl(_PATH_GZIP, _PATH_GZIP, "-f", tmp, (char *)0); - err(1, _PATH_GZIP); - } -} - -/* Fork of bzip2 to compress the old log file */ -static void -bzcompress_log(char *logname, int dowait) -{ - pid_t pid; - char tmp[MAXPATHLEN]; - - while (dowait && (wait(NULL) > 0 || errno == EINTR)) - ; - snprintf(tmp, sizeof(tmp), "%s.0", logname); - pid = fork(); - if (pid < 0) - err(1, "bzip2 fork"); - else if (!pid) { - execl(_PATH_BZIP2, _PATH_BZIP2, "-f", tmp, (char *)0); - err(1, _PATH_BZIP2); - } -} - /* Return size in kilobytes of a file */ static int sizefile(const char *file) ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/config.c#2 (text+ko) ==== @@ -33,7 +33,7 @@ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/ngctl/config.c,v 1.4 2006/05/24 14:46:54 glebius Exp $ + * $FreeBSD: src/usr.sbin/ngctl/config.c,v 1.5 2006/06/28 10:38:38 glebius Exp $ */ #include @@ -69,7 +69,7 @@ /* Get arguments */ if (ac < 2) - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); path = av[1]; *buf = '\0'; @@ -93,7 +93,7 @@ break; default: warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } } else { if (NgRecvMsg(csock, resp, sizeof(sbuf), NULL) < 0 @@ -106,6 +106,6 @@ printf("No config available for \"%s\"\n", path); else printf("Config for \"%s\":\n%s\n", path, status); - return(CMDRTN_OK); + return (CMDRTN_OK); } ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/connect.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/ngctl/connect.c,v 1.4 2006/05/24 14:46:55 glebius Exp $ + * $FreeBSD: src/usr.sbin/ngctl/connect.c,v 1.5 2006/06/28 10:38:38 glebius Exp $ */ #include @@ -76,15 +76,15 @@ snprintf(con.peerhook, sizeof(con.peerhook), "%s", av[3]); break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Send message */ if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_CONNECT, &con, sizeof(con)) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } - return(CMDRTN_OK); + return (CMDRTN_OK); } ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/debug.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/ngctl/debug.c,v 1.3 2006/05/24 14:46:55 glebius Exp $ + * $FreeBSD: src/usr.sbin/ngctl/debug.c,v 1.4 2006/06/28 10:38:38 glebius Exp $ */ #include @@ -70,15 +70,15 @@ else if (!strcmp(av[1], "-")) level = NgSetDebug(-1) - 1; else if ((level = atoi(av[1])) < 0) - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); NgSetDebug(level); break; case 1: printf("Current debug level is %d\n", NgSetDebug(-1)); break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } - return(CMDRTN_OK); + return (CMDRTN_OK); } ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/list.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/ngctl/list.c,v 1.7 2006/05/24 14:46:55 glebius Exp $ + * $FreeBSD: src/usr.sbin/ngctl/list.c,v 1.8 2006/06/28 10:38:38 glebius Exp $ */ #include @@ -83,7 +83,7 @@ break; case '?': default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); break; } } @@ -95,18 +95,18 @@ case 0: break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Get list of nodes */ if (NgSendMsg(csock, ".", NGM_GENERIC_COOKIE, named_only ? NGM_LISTNAMES : NGM_LISTNODES, NULL, 0) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } if (NgAllocRecvMsg(csock, &resp, NULL) < 0) { warn("recv msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } /* Show each node */ ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/main.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/ngctl/main.c,v 1.19 2006/05/24 14:46:55 glebius Exp $ + * $FreeBSD: src/usr.sbin/ngctl/main.c,v 1.20 2006/06/28 10:38:38 glebius Exp $ * $Whistle: main.c,v 1.12 1999/11/29 19:17:46 archie Exp $ */ @@ -188,7 +188,7 @@ rtn = EX_OSERR; break; } - return(rtn); + return (rtn); } /* @@ -205,10 +205,10 @@ continue; if ((rtn = DoParseCommand(line)) != 0) { warnx("line %d: error in file", num); - return(rtn); + return (rtn); } } - return(CMDRTN_OK); + return (CMDRTN_OK); } /* @@ -280,7 +280,7 @@ break; } } - return(CMDRTN_QUIT); + return (CMDRTN_QUIT); } /* @@ -298,7 +298,7 @@ av[++ac] = strtok(NULL, WHITESPACE)); /* Do command */ - return(DoCommand(ac, av)); + return (DoCommand(ac, av)); } /* @@ -311,12 +311,12 @@ int rtn; if (ac == 0 || *av[0] == 0) - return(CMDRTN_OK); + return (CMDRTN_OK); if ((cmd = FindCommand(av[0])) == NULL) - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); if ((rtn = (*cmd->func)(ac, av)) == CMDRTN_USAGE) warnx("usage: %s", cmd->cmd); - return(rtn); + return (rtn); } /* @@ -331,16 +331,16 @@ if (MatchCommand(cmds[k], string)) { if (found != -1) { warnx("\"%s\": ambiguous command", string); - return(NULL); + return (NULL); } found = k; } } if (found == -1) { warnx("\"%s\": unknown command", string); - return(NULL); + return (NULL); } - return(cmds[found]); + return (cmds[found]); } /* @@ -383,17 +383,17 @@ case 2: if ((fp = fopen(av[1], "r")) == NULL) { warn("%s", av[1]); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Process it */ rtn = ReadFile(fp); fclose(fp); - return(rtn); + return (rtn); } /* @@ -419,7 +419,7 @@ *s = '\0'; printf(" %-10s %s\n", buf, cmd->desc); } - return(CMDRTN_OK); + return (CMDRTN_OK); default: /* Show help on a specific command */ if ((cmd = FindCommand(av[1])) != NULL) { @@ -462,7 +462,7 @@ } } } - return(CMDRTN_OK); + return (CMDRTN_OK); } /* @@ -471,7 +471,7 @@ static int QuitCmd(int ac __unused, char **av __unused) { - return(CMDRTN_QUIT); + return (CMDRTN_QUIT); } /* ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/mkpeer.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/ngctl/mkpeer.c,v 1.3 2006/05/24 14:46:55 glebius Exp $ + * $FreeBSD: src/usr.sbin/ngctl/mkpeer.c,v 1.4 2006/06/28 10:38:38 glebius Exp $ */ #include @@ -76,15 +76,15 @@ snprintf(mkp.peerhook, sizeof(mkp.peerhook), "%s", av[3]); break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Send message */ if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_MKPEER, &mkp, sizeof(mkp)) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } - return(CMDRTN_OK); + return (CMDRTN_OK); } ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/msg.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ * OF SUCH DAMAGE. * * $Whistle: msg.c,v 1.2 1999/11/29 23:38:35 archie Exp $ - * $FreeBSD: src/usr.sbin/ngctl/msg.c,v 1.6 2006/05/24 14:46:55 glebius Exp $ + * $FreeBSD: src/usr.sbin/ngctl/msg.c,v 1.7 2006/06/28 10:38:38 glebius Exp $ */ #include @@ -70,7 +70,7 @@ /* Get arguments */ if (ac < 3) - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); path = av[1]; cmdstr = av[2]; @@ -79,7 +79,7 @@ len += strlen(av[i]) + 1; if ((buf = malloc(len)) == NULL) { warn("malloc"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } for (*buf = '\0', i = 3; i < ac; i++) { snprintf(buf + strlen(buf), @@ -90,7 +90,7 @@ if (NgSendAsciiMsg(csock, path, "%s%s", cmdstr, buf) < 0) { free(buf); warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } free(buf); @@ -114,7 +114,7 @@ } /* Done */ - return(CMDRTN_OK); + return (CMDRTN_OK); } /* ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/name.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/ngctl/name.c,v 1.3 2006/05/24 14:46:55 glebius Exp $ + * $FreeBSD: src/usr.sbin/ngctl/name.c,v 1.4 2006/06/28 10:38:38 glebius Exp $ */ #include @@ -67,15 +67,15 @@ snprintf(name.name, sizeof(name.name), "%s", av[2]); break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Send message */ if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_NAME, &name, sizeof(name)) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } - return(CMDRTN_OK); + return (CMDRTN_OK); } ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/rmhook.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/ngctl/rmhook.c,v 1.4 2006/05/24 14:46:55 glebius Exp $ + * $FreeBSD: src/usr.sbin/ngctl/rmhook.c,v 1.5 2006/06/28 10:38:38 glebius Exp $ */ #include @@ -72,15 +72,15 @@ snprintf(rmh.ourhook, sizeof(rmh.ourhook), "%s", av[1]); break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Send message */ if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_RMHOOK, &rmh, sizeof(rmh)) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } - return(CMDRTN_OK); + return (CMDRTN_OK); } ==== //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ngctl/show.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/ngctl/show.c,v 1.5 2006/05/24 14:46:55 glebius Exp $ + * $FreeBSD: src/usr.sbin/ngctl/show.c,v 1.6 2006/06/28 10:38:38 glebius Exp $ */ #include @@ -77,7 +77,7 @@ break; case '?': default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); break; } } @@ -90,18 +90,18 @@ >>> TRUNCATED FOR MAIL (1000 lines) <<<