aboutsummaryrefslogtreecommitdiff
path: root/login
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-07-14 21:49:20 +0000
committerUlrich Drepper <drepper@redhat.com>1997-07-14 21:49:20 +0000
commitcd6ede759fadcf8cd1f8c069928611d18cef5c1a (patch)
tree9d4bbf1daaf37c365dfa5234d1caf2b6b9547708 /login
parentf21acc89c06c14160eab88246e9dbe0b17eb5f89 (diff)
downloadglibc-cd6ede759fadcf8cd1f8c069928611d18cef5c1a.zip
glibc-cd6ede759fadcf8cd1f8c069928611d18cef5c1a.tar.gz
glibc-cd6ede759fadcf8cd1f8c069928611d18cef5c1a.tar.bz2
1997-07-14 23:37 Ulrich Drepper <drepper@cygnus.com> * 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 <drepper@cygnus.com> * sysdeps/stub/bits/stdio_lim.h: Unify with standalone version. * sysdeps/standalone/bits/stdio_lim.h: Removed. Patch by Zack Weinberg <zack@rabi.phys.columbia.edu>. 1997-06-22 Paul Eggert <eggert@twinsun.com> * 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.
Diffstat (limited to 'login')
-rw-r--r--login/programs/utmpd.c51
1 files changed, 25 insertions, 26 deletions
diff --git a/login/programs/utmpd.c b/login/programs/utmpd.c
index 2fef776..1469d94 100644
--- a/login/programs/utmpd.c
+++ b/login/programs/utmpd.c
@@ -44,7 +44,7 @@
#endif
/* Get libc version number. */
-#include "../../version.h"
+#include <version.h>
#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 <kettenis@phys.uva.nl>.\n"),
+ fputs (_("\
+Report bugs using the `glibcbug' script to <bugs@gnu.ai.mit.edu>.\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;
}
-