Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/ldpd return EXIT_SUCCESS and EXIT_FAILURE instead o...
details: https://anonhg.NetBSD.org/src/rev/e71b3028d6bb
branches: trunk
changeset: 766820:e71b3028d6bb
user: kefren <kefren%NetBSD.org@localhost>
date: Sat Jul 02 18:17:12 2011 +0000
description:
return EXIT_SUCCESS and EXIT_FAILURE instead on 0 and -1
diffstat:
usr.sbin/ldpd/main.c | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diffs (94 lines):
diff -r ad3ab00687f2 -r e71b3028d6bb usr.sbin/ldpd/main.c
--- a/usr.sbin/ldpd/main.c Sat Jul 02 17:53:50 2011 +0000
+++ b/usr.sbin/ldpd/main.c Sat Jul 02 18:17:12 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.5 2011/06/14 11:28:51 kefren Exp $ */
+/* $NetBSD: main.c,v 1.6 2011/07/02 18:17:12 kefren Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@
case 'p':
if ((command_port = atoi(optarg)) < 1) {
print_usage(argv[0]);
- return -1;
+ return EXIT_FAILURE;
}
break;
case 'W':
@@ -98,26 +98,26 @@
case 'h':
default:
print_usage(argv[0]);
- return -1;
+ return EXIT_FAILURE;
break;
}
if (geteuid()) {
fatalp("You have to run this as ROOT\n");
- return -1;
+ return EXIT_FAILURE;
}
cpf = conf_parsefile(conffile);
if (cpf < 0 && strcmp(conffile, CONFFILE)) {
fatalp("Cannot parse config file: %s\n", conffile);
- return -1;
+ return EXIT_FAILURE;
} else if (cpf > 0) {
fatalp("Cannot parse line %d in config file\n", cpf);
- return -1;
+ return EXIT_FAILURE;
}
if (set_my_ldp_id()) {
fatalp("Cannot set LDP ID\n");
- return -1;
+ return EXIT_FAILURE;
}
if (conf_ldp_id.s_addr != 0)
strlcpy(my_ldp_id, inet_ntoa(conf_ldp_id), INET_ADDRSTRLEN);
@@ -125,30 +125,30 @@
if (mplssockaddr.sa_len == 0) {
fatalp("You need one mpls interface up and an IP "
"address set for it\n");
- return -1;
+ return EXIT_FAILURE;
}
if (mpls_start_ldp() == -1)
- return -1;
+ return EXIT_FAILURE;
if (!strcmp(LDP_ID, "0.0.0.0")) {
fatalp("Cannot set my LDP ID.\nAre you sure you've "
"got a non-loopback INET interface UP ?\n");
- return -1;
+ return EXIT_FAILURE;
}
init_command_sockets();
if ((command_socket = create_command_socket(command_port)) < 1) {
fatalp("Cannot create command socket\n");
- return -1;
+ return EXIT_FAILURE;
}
if (create_hello_socket() < 1) {
fatalp("Cannot create hello socket\n");
- return -1;
+ return EXIT_FAILURE;
}
ls = create_listening_socket();
if (ls < 0) {
fatalp("Cannot create listening socket\n");
- return -1;
+ return EXIT_FAILURE;
}
if (dontfork == 1)
@@ -162,5 +162,5 @@
if (forkres < 0)
perror("fork");
- return 0;
+ return EXIT_SUCCESS;
}
Home |
Main Index |
Thread Index |
Old Index