Skip to content

Commit

Permalink
Cleanup nscd.c
Browse files Browse the repository at this point in the history
2012-05-09  Andreas Jaeger  <[email protected]>

	* nscd/nscd.c (run_modes): Make named enum, reorder so that
	default is first entry.
	(run_mode): Set type.
	(main): Remove informal message about syslog.
	(options): Fix typo.
  • Loading branch information
ajaeger committed May 9, 2012
1 parent bdd7407 commit edfe0db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
2012-05-09 Andreas Jaeger <[email protected]>

* nscd/nscd.c (run_modes): Make named enum, reorder so that
default is first entry.
(run_mode): Set type.
(main): Remove informal message about syslog.
(options): Fix typo.

[BZ #14053]
* sysdeps/x86_64/fpu/bits/mathinline.h (lrintf): Add __volatile
to asm.
Expand Down
14 changes: 7 additions & 7 deletions nscd/nscd.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,19 @@ int do_shutdown;
int disabled_passwd;
int disabled_group;

static enum
typedef enum
{
/* Running in background as daemon. */
RUN_DAEMONIZE,
/* Running in foreground but otherwise behave like a daemon,
i.e., detach from terminal and use syslog. This allows
better integration with services like systemd. */
RUN_FOREGROUND,
/* Running in background as daemon. */
RUN_DAEMONIZE,
/* Run in foreground in debug mode. */
RUN_DEBUG
} run_mode = RUN_DAEMONIZE;
} run_modes;

static run_modes run_mode = RUN_DAEMONIZE;

static const char *conffile = _PATH_NSCDCONF;

Expand Down Expand Up @@ -115,7 +117,7 @@ static const struct argp_option options[] =
{ "debug", 'd', NULL, 0,
N_("Do not fork and display messages on the current tty") },
{ "foreground", 'F', NULL, 0,
N_("Do not fork, but otherwise behave like a deamon") },
N_("Do not fork, but otherwise behave like a daemon") },
{ "nthreads", 't', N_("NUMBER"), 0, N_("Start NUMBER threads") },
{ "shutdown", 'K', NULL, 0, N_("Shut the server down") },
{ "statistics", 'g', NULL, 0, N_("Print current configuration statistics") },
Expand Down Expand Up @@ -200,8 +202,6 @@ main (int argc, char **argv)
if (pid != 0)
exit (0);
}
else
fprintf (stderr, _("further output sent to syslog\n"));

int nullfd = open (_PATH_DEVNULL, O_RDWR);
if (nullfd != -1)
Expand Down

0 comments on commit edfe0db

Please sign in to comment.