From: Karel Zak Date: Fri, 10 Dec 2010 12:08:33 +0000 (+0100) Subject: login: use EXIT_* in checktty() X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3851ebe8f8ab5434c2f745cc462ce1477dd9f556;p=util-linux login: use EXIT_* in checktty() Signed-off-by: Karel Zak --- diff --git a/login-utils/checktty.c b/login-utils/checktty.c index 92bebfb7..0d1ec0ef 100644 --- a/login-utils/checktty.c +++ b/login-utils/checktty.c @@ -321,13 +321,13 @@ main(int argc, char **argv) if (getaddrinfo(item->ip, NULL, &hints, &info)==0 && info) { if (info->ai_family == AF_INET) { struct sockaddr_in *sa = - (struct sockaddr_in *) info->ai_addr; + (struct sockaddr_in *) info->ai_addr; memcpy(hostaddress, &(sa->sin_addr), sizeof(sa->sin_addr)); } else if (info->ai_family == AF_INET6) { struct sockaddr_in6 *sa = - (struct sockaddr_in6 *) info->ai_addr; + (struct sockaddr_in6 *) info->ai_addr; memcpy(hostaddress, &(sa->sin6_addr), sizeof(sa->sin6_addr)); } @@ -340,7 +340,7 @@ main(int argc, char **argv) printf("getaddrinfo() failed\n"); } - return 0; + return EXIT_SUCCESS; } #endif /* MAIN_TEST_CHECKTTY */ @@ -553,7 +553,7 @@ checktty(const char *user, const char *tty, struct passwd *pwd) /* there was a default rule, but user didn't match, reject! */ printf(_("Login on %s from %s denied by default.\n"), tty, hostname); badlogin(user); - sleepexit(1); + sleepexit(EXIT_FAILURE); } if (found_match) { @@ -564,7 +564,7 @@ checktty(const char *user, const char *tty, struct passwd *pwd) printf(_("Login on %s from %s denied.\n"), tty, hostname); badlogin(user); - sleepexit(1); + sleepexit(EXIT_FAILURE); } /* users not matched in /etc/usertty are by default allowed access