/*
* islocal.c - returns true if user is registered in the local
- * /etc/passwd file. Written by Alvaro Martinez Echevarria,
+ * /etc/passwd file. Written by Álvaro Martínez Echevarria,
* alvaro@enano.etsit.upm.es, to allow peaceful coexistence with yp. Nov 94.
*
* Hacked a bit by poe@daimi.aau.dk
* to distinguish user names where one is a prefix of the other,
* and to use "pathnames.h". Oct 5, 96.
*
- * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+ * 1999-02-22 Arkadiusz Miśkiewicz <misiek@pld.ORG.PL>
* - added Native Language Support
*
* 2008-04-06 James Youngman, jay@gnu.org
int is_local(const char *user)
{
int rv;
- if ((rv = is_local_in_file(user, _PATH_PASSWD)) < 0) {
- perror(_PATH_PASSWD);
- fprintf(stderr, _("cannot open %s"), _PATH_PASSWD);
- exit(1);
- } else {
- return rv;
- }
+
+ if ((rv = is_local_in_file(user, _PATH_PASSWD)) < 0)
+ err(EXIT_FAILURE, _("cannot open %s"), _PATH_PASSWD);
+ return rv;
}
#ifdef TEST_PROGRAM
int main(int argc, char *argv[])
{
- atexit(close_stdout);
+ close_stdout_atexit();
if (argc <= 2) {
fprintf(stderr, _("Usage: %s <passwordfile> <username>...\n"),
argv[0]);