2 * Copyright (C) 2013 Karel Zak <kzak@redhat.com>
15 #include "pathnames.h"
18 * Always return EXIT_FAILURE (1), don't try to be smart!
21 static void __attribute__((__noreturn__
)) usage(FILE *out
)
23 fputs(USAGE_HEADER
, out
);
26 _(" %s [options]\n"), program_invocation_short_name
);
28 fputs(USAGE_OPTIONS
, out
);
29 fputs(USAGE_HELP
, out
);
30 fputs(USAGE_VERSION
, out
);
32 fprintf(out
, USAGE_MAN_TAIL("nologin(8)"));
36 int main(int argc
, char *argv
[])
39 static const struct option longopts
[] = {
40 { "help", 0, 0, 'h' },
41 { "version", 0, 0, 'V' },
45 setlocale(LC_ALL
, "");
46 bindtextdomain(PACKAGE
, LOCALEDIR
);
49 while ((c
= getopt_long(argc
, argv
, "hV", longopts
, NULL
)) != -1) {
55 printf(UTIL_LINUX_VERSION
);
63 fd
= open(_PATH_NOLOGIN_TXT
, O_RDONLY
);
68 while ((rd
= read(fd
, buf
, sizeof(buf
))) > 0)
69 ignore_result( write(STDOUT_FILENO
, buf
, rd
) );
72 fprintf(stdout
, _("This account is currently not available.\n"));