From cd6ede759fadcf8cd1f8c069928611d18cef5c1a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 14 Jul 1997 21:49:20 +0000 Subject: Update. 1997-07-14 23:37 Ulrich Drepper * inet/getnameinfo.c: Pretty print. Correctly enlarge buffers. * login/programs/utmpd.c: Use _() instead of gettext(). * nis/nss_nisplus/nisplus-hosts.c: Optimize some uses of stpcpy away. * nis/nss_nisplus/nisplus-network.c: Likewise. * nis/nss_nisplus/nisplus-proto.c: Likewise. * nis/nss_nisplus/nisplus-rpc.c: Likewise. * nis/nss_nisplus/nisplus-service.c: Likewise. * sysdeps/alpha/fpu/bits/mathinline.h: Only define functions if __OPTIMIZE__. * sysdeps/powerpc/bits/mathinline.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.h: Define ISO C9x comparison function always. * sysdeps/m68k/fpu/bits/mathinline.h: Likewise. * sysdeps/stub/bits/mathinline.h: Add conditionals to show how it should look like in real files. * sysdeps/generic/bits/select.h (__FD_ZERO): Don't use memset to prevent prototype trouble, use simple loop. * sysdeps/i386/bits/select.h [!__GNUC__] (__FD_ZERO): Likewise. * sysdeps/mips/mips64/Implies: Imply ieee754. * sysdeps/unix/sysv/linux/Makefile: Make sure bits/syscall.h is installed. * sysdeps/unix/sysv/linux/sys/syscal.h: Pretty print. 1997-07-14 00:25 Ulrich Drepper * sysdeps/stub/bits/stdio_lim.h: Unify with standalone version. * sysdeps/standalone/bits/stdio_lim.h: Removed. Patch by Zack Weinberg . 1997-06-22 Paul Eggert * time/strftime.c (strftime): Use tm_zone if available, even if _LIBC. * time/tzfile.c (__tzstring): New decl. (__tzfile_read, __tzfile_default): Set __tzname to permanent strings. (__tzfile_default): First two args are now const char *. * time/tzset.c (__tzstring): New function. (tz_rule): Name is now const char *. (struct tzstring_head): New type. (tzstring_list, tzstring_last_buffer_size): New static vars. (__tzset_internal): Time zone names are now permanent, not temporary. --- login/programs/utmpd.c | 51 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'login') diff --git a/login/programs/utmpd.c b/login/programs/utmpd.c index 2fef776a69..1469d94ca7 100644 --- a/login/programs/utmpd.c +++ b/login/programs/utmpd.c @@ -44,7 +44,7 @@ #endif /* Get libc version number. */ -#include "../../version.h" +#include #define PACKAGE _libc_intl_domainname @@ -91,12 +91,12 @@ main (int argc, char *argv[]) /* Set the text message domain. */ textdomain (PACKAGE); - + /* Initialize local variables. */ debug = 0; do_help = 0; do_version = 0; - + while ((opt = getopt_long (argc, argv, "dhV", long_options, NULL)) != -1) switch (opt) { @@ -119,12 +119,12 @@ main (int argc, char *argv[]) if (do_version) { printf ("utmpd (GNU %s) %s\n", PACKAGE, VERSION); - printf (gettext ("\ + printf (_("\ Copyright (C) %s Free Software Foundation, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ "), "1997"); - printf (gettext ("Written by %s.\n"), "Mark Kettenis"); + printf (_("Written by %s.\n"), "Mark Kettenis"); exit (EXIT_SUCCESS); } @@ -136,7 +136,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ signal (SIGINT, termination_handler); signal (SIGQUIT, termination_handler); signal (SIGTERM, termination_handler); - + /* Check if we are already running. */ if (check_pid (_PATH_UTMPDPID)) error (EXIT_FAILURE, 0, _("already running")); @@ -163,7 +163,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ if (!debug) { openlog ("utmpd", LOG_CONS | LOG_ODELAY, LOG_DAEMON); - + if (daemon (0, 0) < 0) error (EXIT_FAILURE, errno, _("cannot auto-background")); forked = 1; @@ -176,10 +176,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ signal (SIGTTIN, SIG_IGN); signal (SIGTSTP, SIG_IGN); } - + /* Drop priviliges. */ drop_priviliges (); - + /* Handle incoming requests. */ handle_requests (); } @@ -190,21 +190,21 @@ static void usage (int status) { if (status != EXIT_SUCCESS) - fprintf (stderr, gettext ("Try `%s --help' for more information.\n"), + fprintf (stderr, _("Try `%s --help' for more information.\n"), program_invocation_name); else { - printf (gettext ("\ + printf (_("\ Usage: %s [OPTION]...\n\ -d, --debug do not fork and display messages on the current tty\n\ -h, --help display this help and exit\n\ -V, --version output version information and exit\n"), program_invocation_name); - fputs (gettext ("\ -Report bugs to .\n"), + fputs (_("\ +Report bugs using the `glibcbug' script to .\n"), stdout); } - + exit (status); } @@ -247,10 +247,10 @@ make_socket (const char *name) terminating null byte. */ size = (offsetof (struct sockaddr_un, sun_path) + strlen (addr.sun_path)); - + if (bind (sock, (struct sockaddr *) &addr, size) < 0) error (EXIT_FAILURE, errno, "%s", name); - + return sock; } @@ -265,7 +265,7 @@ void handle_requests (void) fd_set read_fd_set; fd_set write_fd_set; int fd; - + /* Initialize the set of active sockets. */ FD_ZERO (&active_read_fd_set); FD_ZERO (&active_write_fd_set); @@ -329,7 +329,7 @@ void handle_requests (void) if (connection->write_ptr == connection->write_base) FD_CLR (fd, &active_write_fd_set); } - } + } } } @@ -344,7 +344,7 @@ termination_handler (int signum) /* Restore user id. */ seteuid (getuid ()); - + /* Clean up the files created by `bind'. */ unlink (_PATH_UTMPD_RO); unlink (_PATH_UTMPD_RW); @@ -354,7 +354,7 @@ termination_handler (int signum) /* Clean up pid file. */ unlink (_PATH_UTMPDPID); - + exit (EXIT_SUCCESS); } @@ -364,12 +364,12 @@ static int check_pid (const char *file) { FILE *fp; - + fp = fopen (_PATH_UTMPDPID, "r"); if (fp) { pid_t pid; - + fscanf (fp, "%d", &pid); fclose (fp); @@ -386,17 +386,16 @@ static int write_pid (const char *file) { FILE *fp; - + fp = fopen (_PATH_UTMPDPID, "w"); if (fp == NULL) return -1; - + fprintf (fp, "%d\n", getpid ()); if (ferror (fp)) return -1; - + fclose (fp); return 0; } - -- cgit v1.2.3