git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16704 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2003-05-12 20:42:47 +00:00
parent cd13d283b2
commit a62efff84c
15 changed files with 125 additions and 125 deletions

View file

@ -557,7 +557,7 @@ main(int argc, char **argv, char **env)
NSLog(@"ERROR: The GNUstep Base Library was built\n" NSLog(@"ERROR: The GNUstep Base Library was built\n"
@" without an available libxml library. Autogsdoc needs the libxml\n" @" without an available libxml library. Autogsdoc needs the libxml\n"
@" library to function. Aborting"); @" library to function. Aborting");
exit(1); exit(EXIT_FAILURE);
#endif #endif
defs = [NSUserDefaults standardUserDefaults]; defs = [NSUserDefaults standardUserDefaults];
@ -604,7 +604,7 @@ main(int argc, char **argv, char **env)
if (proc == nil) if (proc == nil)
{ {
NSLog(@"unable to get process information!"); NSLog(@"unable to get process information!");
exit(1); exit(EXIT_FAILURE);
} }
/* /*
@ -617,7 +617,7 @@ main(int argc, char **argv, char **env)
if (files == nil) if (files == nil)
{ {
NSLog(@"Failed to load files from '%@'", obj); NSLog(@"Failed to load files from '%@'", obj);
exit(1); exit(EXIT_FAILURE);
} }
firstFile = 0; // Not an argument list ... read from index 0 firstFile = 0; // Not an argument list ... read from index 0
} }

View file

@ -61,7 +61,7 @@ main(int argc, char** argv, char **env)
{ {
NSLog(@"defaults: unable to get process information!\n"); NSLog(@"defaults: unable to get process information!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
args = [proc arguments]; args = [proc arguments];
@ -97,7 +97,7 @@ main(int argc, char** argv, char **env)
NSLog(@"defaults: unable to find encoding '%@'!\n" NSLog(@"defaults: unable to find encoding '%@'!\n"
@"Known encoding names are -\n%@", n, names); @"Known encoding names are -\n%@", n, names);
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }

View file

@ -57,7 +57,7 @@ main(int argc, char** argv, char **env)
{ {
GSPrintf(stderr, @"defaults: unable to get process information!\n"); GSPrintf(stderr, @"defaults: unable to get process information!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
args = [proc arguments]; args = [proc arguments];
@ -116,7 +116,7 @@ main(int argc, char** argv, char **env)
"defaults help\n" "defaults help\n"
" list options fo the defaults command.\n\n"); " list options fo the defaults command.\n\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
else if ([[args objectAtIndex: i] isEqual: @"plist"]) else if ([[args objectAtIndex: i] isEqual: @"plist"])
{ {
@ -171,7 +171,7 @@ main(int argc, char** argv, char **env)
" Checksum = <01014b5b 123a8b20>\n" " Checksum = <01014b5b 123a8b20>\n"
"}'\n\n"); "}'\n\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
@ -180,7 +180,7 @@ main(int argc, char** argv, char **env)
{ {
GSPrintf(stderr, @"defaults: too few arguments supplied!\n"); GSPrintf(stderr, @"defaults: too few arguments supplied!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
if ([[args objectAtIndex: i] isEqual: @"-u"]) if ([[args objectAtIndex: i] isEqual: @"-u"])
{ {
@ -192,7 +192,7 @@ main(int argc, char** argv, char **env)
{ {
GSPrintf(stderr, @"defaults: no name supplied for -u option!\n"); GSPrintf(stderr, @"defaults: no name supplied for -u option!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
if (user) if (user)
@ -208,7 +208,7 @@ main(int argc, char** argv, char **env)
{ {
GSPrintf(stderr, @"defaults: unable to access defaults database!\n"); GSPrintf(stderr, @"defaults: unable to access defaults database!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
/* We don't want this tool in the defaults database - so remove it. */ /* We don't want this tool in the defaults database - so remove it. */
[defs removePersistentDomainForName: [proc processName]]; [defs removePersistentDomainForName: [proc processName]];
@ -217,7 +217,7 @@ main(int argc, char** argv, char **env)
{ {
GSPrintf(stderr, @"defaults: too few arguments supplied!\n"); GSPrintf(stderr, @"defaults: too few arguments supplied!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
if ([[args objectAtIndex: i] isEqual: @"read"] || if ([[args objectAtIndex: i] isEqual: @"read"] ||
@ -247,7 +247,7 @@ main(int argc, char** argv, char **env)
{ {
GSPrintf(stderr, @"defaults: too few arguments supplied!\n"); GSPrintf(stderr, @"defaults: too few arguments supplied!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
owner = nil; owner = nil;
name = [args objectAtIndex: i]; name = [args objectAtIndex: i];
@ -367,7 +367,7 @@ main(int argc, char** argv, char **env)
{ {
printf("defaults write: invalid input - nul domain name\n"); printf("defaults write: invalid input - nul domain name\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
for (str = start; *str; str++) for (str = start; *str; str++)
{ {
@ -376,7 +376,7 @@ main(int argc, char** argv, char **env)
printf("defaults write: invalid input - " printf("defaults write: invalid input - "
"space in domain name.\n"); "space in domain name.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
owner = [NSString stringWithCString: start]; owner = [NSString stringWithCString: start];
@ -403,7 +403,7 @@ main(int argc, char** argv, char **env)
printf("defaults write: invalid input - " printf("defaults write: invalid input - "
"nul default name.\n"); "nul default name.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
for (str = start; *str; str++) for (str = start; *str; str++)
{ {
@ -412,7 +412,7 @@ main(int argc, char** argv, char **env)
printf("defaults write: invalid input - " printf("defaults write: invalid input - "
"space in default name.\n"); "space in default name.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
name = [NSString stringWithCString: start]; name = [NSString stringWithCString: start];
@ -448,7 +448,7 @@ main(int argc, char** argv, char **env)
printf("defaults write: fatal error - " printf("defaults write: fatal error - "
"out of memory.\n"); "out of memory.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
if (fgets(ptr, BUFSIZ, stdin) == 0) if (fgets(ptr, BUFSIZ, stdin) == 0)
@ -456,7 +456,7 @@ main(int argc, char** argv, char **env)
printf("defaults write: invalid input - " printf("defaults write: invalid input - "
"no final quote.\n"); "no final quote.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
if (*ptr == '\'') if (*ptr == '\'')
@ -489,7 +489,7 @@ main(int argc, char** argv, char **env)
printf("defaults write: invalid input - " printf("defaults write: invalid input - "
"empty property list\n"); "empty property list\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
/* /*
@ -506,7 +506,7 @@ main(int argc, char** argv, char **env)
printf("defaults write: invalid input - " printf("defaults write: invalid input - "
"bad property list\n"); "bad property list\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
else else
{ {
@ -530,7 +530,7 @@ main(int argc, char** argv, char **env)
{ {
GSPrintf(stderr, @"defaults: no dictionary or key for write!\n"); GSPrintf(stderr, @"defaults: no dictionary or key for write!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
name = [args objectAtIndex: i++]; name = [args objectAtIndex: i++];
if ([args count] > i) if ([args count] > i)
@ -549,7 +549,7 @@ main(int argc, char** argv, char **env)
printf("defaults write: invalid input - " printf("defaults write: invalid input - "
"bad property list\n"); "bad property list\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
else else
@ -574,7 +574,7 @@ main(int argc, char** argv, char **env)
GSPrintf(stderr, GSPrintf(stderr,
@"defaults write: domain is not a dictionary!\n"); @"defaults write: domain is not a dictionary!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
} }
@ -615,7 +615,7 @@ main(int argc, char** argv, char **env)
{ {
printf("defaults delete: invalid input\n"); printf("defaults delete: invalid input\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
owner = [NSString stringWithCString: start]; owner = [NSString stringWithCString: start];
start = ptr; start = ptr;
@ -636,7 +636,7 @@ main(int argc, char** argv, char **env)
{ {
printf("defaults delete: invalid input\n"); printf("defaults delete: invalid input\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
name = [NSString stringWithCString: start]; name = [NSString stringWithCString: start];
domain = [[defs persistentDomainForName: owner] mutableCopy]; domain = [[defs persistentDomainForName: owner] mutableCopy];
@ -705,7 +705,7 @@ main(int argc, char** argv, char **env)
{ {
GSPrintf(stderr, @"defaults: no arguments for find!\n"); GSPrintf(stderr, @"defaults: no arguments for find!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
name = [args objectAtIndex: i]; name = [args objectAtIndex: i];
@ -763,6 +763,6 @@ main(int argc, char** argv, char **env)
} }
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }

View file

@ -46,7 +46,7 @@ main(int argc, char** argv)
if (proc == nil) { if (proc == nil) {
NSLog(@"unable to get process information!\n"); NSLog(@"unable to get process information!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
args = [proc arguments]; args = [proc arguments];
@ -81,7 +81,7 @@ main(int argc, char** argv)
"dread [-u uname] key\n" "dread [-u uname] key\n"
" read default named 'key' from the global domain.\n"); " read default named 'key' from the global domain.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
@ -89,7 +89,7 @@ main(int argc, char** argv)
if ([args count] <= i) { if ([args count] <= i) {
NSLog(@"too few arguments supplied!\n"); NSLog(@"too few arguments supplied!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
if ([[args objectAtIndex: i] isEqual: @"-u"]) { if ([[args objectAtIndex: i] isEqual: @"-u"]) {
@ -99,14 +99,14 @@ main(int argc, char** argv)
else { else {
NSLog(@"no name supplied for -u option!\n"); NSLog(@"no name supplied for -u option!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
if ([args count] <= i) { if ([args count] <= i) {
NSLog(@"too few arguments supplied!\n"); NSLog(@"too few arguments supplied!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
if ([[args objectAtIndex: i] isEqual: @"-g"]) { if ([[args objectAtIndex: i] isEqual: @"-g"]) {
@ -117,7 +117,7 @@ main(int argc, char** argv)
else { else {
NSLog(@"no key supplied for -g option!\n"); NSLog(@"no key supplied for -g option!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
else if ([[args objectAtIndex: i] isEqual: @"-n"]) { else if ([[args objectAtIndex: i] isEqual: @"-n"]) {
@ -128,7 +128,7 @@ main(int argc, char** argv)
else { else {
NSLog(@"no key supplied for -n option!\n"); NSLog(@"no key supplied for -n option!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
else if ([[args objectAtIndex: i] isEqual: @"-o"]) { else if ([[args objectAtIndex: i] isEqual: @"-o"]) {
@ -139,7 +139,7 @@ main(int argc, char** argv)
else { else {
NSLog(@"no domain name supplied for -o option!\n"); NSLog(@"no domain name supplied for -o option!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
else if ([[args objectAtIndex: i] isEqual: @"-l"]) { else if ([[args objectAtIndex: i] isEqual: @"-l"]) {
@ -166,7 +166,7 @@ main(int argc, char** argv)
if (defs == nil) { if (defs == nil) {
NSLog(@"unable to access defaults database!\n"); NSLog(@"unable to access defaults database!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
/* We don't want dwrite in the defaults database - so remove it. */ /* We don't want dwrite in the defaults database - so remove it. */
[defs removePersistentDomainForName: [proc processName]]; [defs removePersistentDomainForName: [proc processName]];
@ -232,7 +232,7 @@ main(int argc, char** argv)
} }
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }

View file

@ -45,7 +45,7 @@ main(int argc, char** argv)
if (proc == nil) { if (proc == nil) {
NSLog(@"unable to get process information!\n"); NSLog(@"unable to get process information!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
args = [proc arguments]; args = [proc arguments];
@ -73,7 +73,7 @@ main(int argc, char** argv)
" default key pairs to be removed. Domain names and default keys must be\n" " default key pairs to be removed. Domain names and default keys must be\n"
" separated by spaces.\n"); " separated by spaces.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
@ -85,7 +85,7 @@ main(int argc, char** argv)
else { else {
NSLog(@"no name supplied for -u option!\n"); NSLog(@"no name supplied for -u option!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
@ -98,7 +98,7 @@ main(int argc, char** argv)
if (defs == nil) { if (defs == nil) {
NSLog(@"unable to access defaults database!\n"); NSLog(@"unable to access defaults database!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
if ([args count] == i) { if ([args count] == i) {
@ -123,7 +123,7 @@ main(int argc, char** argv)
if (*start == '\0') { if (*start == '\0') {
printf("dremove: invalid input\n"); printf("dremove: invalid input\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
owner = [NSString stringWithCString: start]; owner = [NSString stringWithCString: start];
start = ptr; start = ptr;
@ -141,7 +141,7 @@ main(int argc, char** argv)
if (*start == '\0') { if (*start == '\0') {
printf("dremove: invalid input\n"); printf("dremove: invalid input\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
name = [NSString stringWithCString: start]; name = [NSString stringWithCString: start];
domain = [[defs persistentDomainForName: owner] mutableCopy]; domain = [[defs persistentDomainForName: owner] mutableCopy];
@ -163,7 +163,7 @@ main(int argc, char** argv)
else { else {
NSLog(@"no key supplied for -g option.\n"); NSLog(@"no key supplied for -g option.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
domain = [[defs persistentDomainForName: owner] mutableCopy]; domain = [[defs persistentDomainForName: owner] mutableCopy];
if (domain == nil || [domain objectForKey: name] == nil) { if (domain == nil || [domain objectForKey: name] == nil) {
@ -182,7 +182,7 @@ main(int argc, char** argv)
else { else {
NSLog(@"no domain supplied for -o option.\n"); NSLog(@"no domain supplied for -o option.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
[defs removePersistentDomainForName: owner]; [defs removePersistentDomainForName: owner];
} }
@ -204,7 +204,7 @@ main(int argc, char** argv)
NSLog(@"got app name '%s' but no variable name.\n", NSLog(@"got app name '%s' but no variable name.\n",
[[args objectAtIndex: 0] cString]); [[args objectAtIndex: 0] cString]);
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
@ -215,7 +215,7 @@ main(int argc, char** argv)
} }
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }

View file

@ -48,7 +48,7 @@ main(int argc, char** argv)
if (proc == nil) { if (proc == nil) {
NSLog(@"unable to get process information!\n"); NSLog(@"unable to get process information!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
args = [proc arguments]; args = [proc arguments];
@ -77,7 +77,7 @@ main(int argc, char** argv)
" written. Domain names, default keys, and default values must be\n" " written. Domain names, default keys, and default values must be\n"
" separated on each line by spaces.\n"); " separated on each line by spaces.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
@ -89,7 +89,7 @@ main(int argc, char** argv)
else { else {
NSLog(@"no name supplied for -u option!\n"); NSLog(@"no name supplied for -u option!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
@ -102,7 +102,7 @@ main(int argc, char** argv)
if (defs == nil) { if (defs == nil) {
NSLog(@"unable to access defaults database!\n"); NSLog(@"unable to access defaults database!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
/* We don't want dwrite in the defaults database - so remove it. */ /* We don't want dwrite in the defaults database - so remove it. */
[defs removePersistentDomainForName: [proc processName]]; [defs removePersistentDomainForName: [proc processName]];
@ -130,13 +130,13 @@ main(int argc, char** argv)
if (*start == '\0') { if (*start == '\0') {
printf("dwrite: invalid input - nul domain name\n"); printf("dwrite: invalid input - nul domain name\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
for (str = start; *str; str++) { for (str = start; *str; str++) {
if (isspace(*str)) { if (isspace(*str)) {
printf("dwrite: invalid input - space in domain name.\n"); printf("dwrite: invalid input - space in domain name.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
owner = [NSString stringWithCString: start]; owner = [NSString stringWithCString: start];
@ -155,13 +155,13 @@ main(int argc, char** argv)
if (*start == '\0') { if (*start == '\0') {
printf("dwrite: invalid input - nul default name.\n"); printf("dwrite: invalid input - nul default name.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
for (str = start; *str; str++) { for (str = start; *str; str++) {
if (isspace(*str)) { if (isspace(*str)) {
printf("dwrite: invalid input - space in default name.\n"); printf("dwrite: invalid input - space in default name.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
name = [NSString stringWithCString: start]; name = [NSString stringWithCString: start];
@ -173,7 +173,7 @@ main(int argc, char** argv)
if (fgets(ptr, sizeof(buf) - (ptr-buf), stdin) == 0) { if (fgets(ptr, sizeof(buf) - (ptr-buf), stdin) == 0) {
printf("dwrite: invalid input - no final quote.\n"); printf("dwrite: invalid input - no final quote.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
if (*ptr == '\'') { if (*ptr == '\'') {
@ -199,7 +199,7 @@ main(int argc, char** argv)
if (*start == '\0') { if (*start == '\0') {
printf("dwrite: invalid input - empty property list\n"); printf("dwrite: invalid input - empty property list\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
obj = [NSString stringWithCString: start]; obj = [NSString stringWithCString: start];
if (*start == '(' || *start == '{' || *start == '<') { if (*start == '(' || *start == '{' || *start == '<') {
@ -208,7 +208,7 @@ main(int argc, char** argv)
if (tmp == nil) { if (tmp == nil) {
printf("dwrite: invalid input - bad property list\n"); printf("dwrite: invalid input - bad property list\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
else { else {
obj = tmp; obj = tmp;
@ -231,7 +231,7 @@ main(int argc, char** argv)
if (isspace(*str)) { if (isspace(*str)) {
printf("dwrite: invalid input - space in default name.\n"); printf("dwrite: invalid input - space in default name.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
value = [args objectAtIndex: ++i]; value = [args objectAtIndex: ++i];
@ -245,7 +245,7 @@ main(int argc, char** argv)
if (obj == nil) { if (obj == nil) {
printf("dwrite: invalid input - bad property list\n"); printf("dwrite: invalid input - bad property list\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
domain = [[defs persistentDomainForName: owner] mutableCopy]; domain = [[defs persistentDomainForName: owner] mutableCopy];
if (domain == nil) { if (domain == nil) {
@ -257,7 +257,7 @@ main(int argc, char** argv)
else { else {
NSLog(@"too few arguments supplied!\n"); NSLog(@"too few arguments supplied!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
else { else {
@ -267,7 +267,7 @@ main(int argc, char** argv)
if (isspace(*str)) { if (isspace(*str)) {
printf("dwrite: invalid input - space in domain name.\n"); printf("dwrite: invalid input - space in domain name.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
name = [args objectAtIndex: ++i]; name = [args objectAtIndex: ++i];
@ -275,7 +275,7 @@ main(int argc, char** argv)
if (isspace(*str)) { if (isspace(*str)) {
printf("dwrite: invalid input - space in default name.\n"); printf("dwrite: invalid input - space in default name.\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
value = [args objectAtIndex: ++i]; value = [args objectAtIndex: ++i];
@ -289,7 +289,7 @@ main(int argc, char** argv)
if (obj == nil) { if (obj == nil) {
printf("dwrite: invalid input - bad property list\n"); printf("dwrite: invalid input - bad property list\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
domain = [[defs persistentDomainForName: owner] mutableCopy]; domain = [[defs persistentDomainForName: owner] mutableCopy];
if (domain == nil) { if (domain == nil) {
@ -301,14 +301,14 @@ main(int argc, char** argv)
else { else {
NSLog(@"too few arguments supplied!\n"); NSLog(@"too few arguments supplied!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
} }
[defs synchronize]; [defs synchronize];
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }

View file

@ -419,7 +419,7 @@
if (connection == conn) if (connection == conn)
{ {
NSLog(@"argh - gdnc server root connection has been destroyed."); NSLog(@"argh - gdnc server root connection has been destroyed.");
exit(1); exit(EXIT_FAILURE);
} }
else else
{ {
@ -826,9 +826,9 @@ main(int argc, char** argv, char** env)
if (_spawnv(_P_NOWAIT, argv[0], a) == -1) if (_spawnv(_P_NOWAIT, argv[0], a) == -1)
{ {
fprintf(stderr, "gdnc - spawn failed - bye.\n"); fprintf(stderr, "gdnc - spawn failed - bye.\n");
exit(1); exit(EXIT_FAILURE);
} }
exit(0); exit(EXIT_SUCCESS);
} }
#else #else
if (shouldFork) if (shouldFork)
@ -837,7 +837,7 @@ main(int argc, char** argv, char** env)
{ {
case -1: case -1:
fprintf(stderr, "gdnc - fork failed - bye.\n"); fprintf(stderr, "gdnc - fork failed - bye.\n");
exit(1); exit(EXIT_FAILURE);
case 0: case 0:
/* /*
@ -851,7 +851,7 @@ main(int argc, char** argv, char** env)
break; break;
default: default:
exit(0); exit(EXIT_SUCCESS);
} }
} }
#endif /* !MINGW */ #endif /* !MINGW */
@ -891,6 +891,6 @@ main(int argc, char** argv, char** env)
[[NSRunLoop currentRunLoop] run]; [[NSRunLoop currentRunLoop] run];
RELEASE(pool); RELEASE(pool);
} }
exit(0); exit(EXIT_SUCCESS);
} }

View file

@ -283,7 +283,7 @@ gdomap_log (int prio)
fprintf (stderr, "exiting.\n"); fprintf (stderr, "exiting.\n");
fflush (stderr); fflush (stderr);
} }
exit(1); exit(EXIT_FAILURE);
} }
} }
#else #else
@ -302,7 +302,7 @@ gdomap_log (int prio)
{ {
fprintf (stderr, "exiting.\n"); fprintf (stderr, "exiting.\n");
fflush (stderr); fflush (stderr);
exit(1); exit(EXIT_FAILURE);
} }
} }
#endif #endif
@ -1083,7 +1083,7 @@ init_iface()
{ {
sprintf(ebuf, "Failed to get a socket. Error %s\n", WSAGetLastError()); sprintf(ebuf, "Failed to get a socket. Error %s\n", WSAGetLastError());
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
memset((void*)InterfaceList, '\0', sizeof(InterfaceList)); memset((void*)InterfaceList, '\0', sizeof(InterfaceList));
@ -1092,7 +1092,7 @@ init_iface()
{ {
sprintf(ebuf, "Failed WSAIoctl. Error %s\n", WSAGetLastError()); sprintf(ebuf, "Failed WSAIoctl. Error %s\n", WSAGetLastError());
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
nNumInterfaces = nBytesReturned / sizeof(INTERFACE_INFO); nNumInterfaces = nBytesReturned / sizeof(INTERFACE_INFO);
@ -1190,7 +1190,7 @@ init_iface()
if ((desc = socket(AF_INET, SOCK_DGRAM, 0)) < 0) if ((desc = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
{ {
perror("socket for init_iface"); perror("socket for init_iface");
exit(1); exit(EXIT_FAILURE);
} }
#if defined(__svr4__) #if defined(__svr4__)
{ {
@ -1237,7 +1237,7 @@ init_iface()
gdomap_log(LOG_INFO); gdomap_log(LOG_INFO);
} }
close(desc); close(desc);
exit(1); exit(EXIT_FAILURE);
} }
/* /*
* We cannot know the number of interfaces in advance, thus we * We cannot know the number of interfaces in advance, thus we
@ -1305,7 +1305,7 @@ init_iface()
"gdomap to manually set the interface addresses and masks to be used."); "gdomap to manually set the interface addresses and masks to be used.");
gdomap_log(LOG_INFO); gdomap_log(LOG_INFO);
close(desc); close(desc);
exit(1); exit(EXIT_FAILURE);
} }
addr[interfaces] = addr[interfaces] =
((struct sockaddr_in *)&ifreq.ifr_addr)->sin_addr; ((struct sockaddr_in *)&ifreq.ifr_addr)->sin_addr;
@ -1377,7 +1377,7 @@ init_iface()
sprintf(ebuf, "I can't find any network interfaces on this platform - " sprintf(ebuf, "I can't find any network interfaces on this platform - "
"use the '-a' flag to load interface details from a file instead."); "use the '-a' flag to load interface details from a file instead.");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
} }
@ -1397,7 +1397,7 @@ load_iface(const char* from)
{ {
sprintf(ebuf, "Unable to open address config - '%s'", from); sprintf(ebuf, "Unable to open address config - '%s'", from);
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
while (fgets(buf, sizeof(buf), fptr) != 0) while (fgets(buf, sizeof(buf), fptr) != 0)
@ -1451,7 +1451,7 @@ load_iface(const char* from)
{ {
sprintf(ebuf, "No network interfaces found"); sprintf(ebuf, "No network interfaces found");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
num_iface++; num_iface++;
addr = (struct in_addr*)malloc((num_iface+1)*IASIZE); addr = (struct in_addr*)malloc((num_iface+1)*IASIZE);
@ -1648,7 +1648,7 @@ init_ports()
{ {
sprintf(ebuf, "Unable to create UDP socket"); sprintf(ebuf, "Unable to create UDP socket");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
else if (debug) else if (debug)
{ {
@ -1685,7 +1685,7 @@ init_ports()
{ {
sprintf(ebuf, "Unable to handle UDP socket non-blocking"); sprintf(ebuf, "Unable to handle UDP socket non-blocking");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
#else /* !__MINGW__ */ #else /* !__MINGW__ */
if ((r = fcntl(udp_desc, F_GETFL, 0)) >= 0) if ((r = fcntl(udp_desc, F_GETFL, 0)) >= 0)
@ -1695,14 +1695,14 @@ init_ports()
{ {
sprintf(ebuf, "Unable to set UDP socket non-blocking"); sprintf(ebuf, "Unable to set UDP socket non-blocking");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
} }
else else
{ {
sprintf(ebuf, "Unable to handle UDP socket non-blocking"); sprintf(ebuf, "Unable to handle UDP socket non-blocking");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
#endif #endif
/* /*
@ -1726,7 +1726,7 @@ init_ports()
"privilege (poor option and last resort!!!)"); "privilege (poor option and last resort!!!)");
gdomap_log(LOG_INFO); gdomap_log(LOG_INFO);
} }
exit(1); exit(EXIT_FAILURE);
} }
/* /*
@ -1741,7 +1741,7 @@ init_ports()
{ {
sprintf(ebuf, "Unable to create TCP socket"); sprintf(ebuf, "Unable to create TCP socket");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
else if (debug) else if (debug)
{ {
@ -1769,7 +1769,7 @@ init_ports()
{ {
sprintf(ebuf, "Unable to handle TCP socket non-blocking"); sprintf(ebuf, "Unable to handle TCP socket non-blocking");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
#else /* !__MINGW__ */ #else /* !__MINGW__ */
if ((r = fcntl(tcp_desc, F_GETFL, 0)) >= 0) if ((r = fcntl(tcp_desc, F_GETFL, 0)) >= 0)
@ -1779,14 +1779,14 @@ init_ports()
{ {
sprintf(ebuf, "Unable to set TCP socket non-blocking"); sprintf(ebuf, "Unable to set TCP socket non-blocking");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
} }
else else
{ {
sprintf(ebuf, "Unable to handle TCP socket non-blocking"); sprintf(ebuf, "Unable to handle TCP socket non-blocking");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
#endif /* __MINGW__ */ #endif /* __MINGW__ */
@ -1807,13 +1807,13 @@ init_ports()
"privilege (poor option and last resort!!!)"); "privilege (poor option and last resort!!!)");
gdomap_log(LOG_INFO); gdomap_log(LOG_INFO);
} }
exit(1); exit(EXIT_FAILURE);
} }
if (listen(tcp_desc, QUEBACKLOG) < 0) if (listen(tcp_desc, QUEBACKLOG) < 0)
{ {
sprintf(ebuf, "Unable to listen for connections on TCP socket"); sprintf(ebuf, "Unable to listen for connections on TCP socket");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
/* /*
@ -2281,7 +2281,7 @@ handle_io()
{ {
sprintf(ebuf, "Fatal error on socket."); sprintf(ebuf, "Fatal error on socket.");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
} }
} }
@ -2299,7 +2299,7 @@ handle_io()
{ {
sprintf(ebuf, "Interrupted in select."); sprintf(ebuf, "Interrupted in select.");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
} }
else if (rval == 0) else if (rval == 0)
@ -4178,7 +4178,7 @@ main(int argc, char** argv)
printf("Kill with SIGUSR1 to obtain a dump of all known peers\n"); printf("Kill with SIGUSR1 to obtain a dump of all known peers\n");
printf("in /tmp/gdomap.dump\n"); printf("in /tmp/gdomap.dump\n");
printf("\n"); printf("\n");
exit(0); exit(EXIT_SUCCESS);
case 'C': case 'C':
printf("\n"); printf("\n");
@ -4223,7 +4223,7 @@ printf(
"network interfaces and masks, please send me example code so that I can\n" "network interfaces and masks, please send me example code so that I can\n"
"implement it in gdomap.\n"); "implement it in gdomap.\n");
printf("\n"); printf("\n");
exit(0); exit(EXIT_SUCCESS);
case 'L': case 'L':
lookupf = optarg; lookupf = optarg;
@ -4248,7 +4248,7 @@ printf(
fprintf(stderr, "Registration will take place locally.\n"); fprintf(stderr, "Registration will take place locally.\n");
} }
doregister(optarg, port, ptype); doregister(optarg, port, ptype);
exit(0); exit(EXIT_SUCCESS);
case 'T': case 'T':
if (strcmp(optarg, "tcp_gdo") == 0) if (strcmp(optarg, "tcp_gdo") == 0)
@ -4282,7 +4282,7 @@ printf(
fprintf(stderr, "Operation will take place locally.\n"); fprintf(stderr, "Operation will take place locally.\n");
} }
unregister(optarg, port, ptype); unregister(optarg, port, ptype);
exit(0); exit(EXIT_SUCCESS);
case 'a': case 'a':
load_iface(optarg); load_iface(optarg);
@ -4301,7 +4301,7 @@ printf(
{ {
fprintf(stderr, "Unable to open probe config - '%s'\n", fprintf(stderr, "Unable to open probe config - '%s'\n",
optarg); optarg);
exit(1); exit(EXIT_FAILURE);
} }
while (fgets(buf, sizeof(buf), fptr) != 0) while (fgets(buf, sizeof(buf), fptr) != 0)
{ {
@ -4418,7 +4418,7 @@ printf(
default: default:
printf("%s - GNU Distributed Objects name server\n", argv[0]); printf("%s - GNU Distributed Objects name server\n", argv[0]);
printf("-H for help\n"); printf("-H for help\n");
exit(0); exit(EXIT_SUCCESS);
} }
} }
if (donamesf || lookupf) if (donamesf || lookupf)
@ -4445,14 +4445,14 @@ printf(
if (_spawnv(_P_NOWAIT, argv[0], a) == -1) if (_spawnv(_P_NOWAIT, argv[0], a) == -1)
{ {
fprintf(stderr, "gdomap - spawn '%s' failed - bye.\n", argv[0]); fprintf(stderr, "gdomap - spawn '%s' failed - bye.\n", argv[0]);
exit(1); exit(EXIT_FAILURE);
} }
if (debug) if (debug)
{ {
sprintf(ebuf, "initialisation complete."); sprintf(ebuf, "initialisation complete.");
gdomap_log(LOG_DEBUG); gdomap_log(LOG_DEBUG);
} }
exit(0); exit(EXIT_SUCCESS);
} }
#else #else
if (nofork == 0) if (nofork == 0)
@ -4465,7 +4465,7 @@ printf(
{ {
case -1: case -1:
fprintf(stderr, "gdomap - fork failed - bye.\n"); fprintf(stderr, "gdomap - fork failed - bye.\n");
exit(1); exit(EXIT_FAILURE);
case 0: case 0:
/* /*
@ -4484,7 +4484,7 @@ printf(
sprintf(ebuf, "initialisation complete."); sprintf(ebuf, "initialisation complete.");
gdomap_log(LOG_DEBUG); gdomap_log(LOG_DEBUG);
} }
exit(0); exit(EXIT_SUCCESS);
} }
} }
@ -4506,21 +4506,21 @@ printf(
sprintf(ebuf, "failed to open stdin from /dev/null (%s)\n", sprintf(ebuf, "failed to open stdin from /dev/null (%s)\n",
strerror(errno)); strerror(errno));
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
if (open("/dev/null", O_WRONLY) != 1) if (open("/dev/null", O_WRONLY) != 1)
{ {
sprintf(ebuf, "failed to open stdout from /dev/null (%s)\n", sprintf(ebuf, "failed to open stdout from /dev/null (%s)\n",
strerror(errno)); strerror(errno));
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
if (is_daemon && open("/dev/null", O_WRONLY) != 2) if (is_daemon && open("/dev/null", O_WRONLY) != 2)
{ {
sprintf(ebuf, "failed to open stderr from /dev/null (%s)\n", sprintf(ebuf, "failed to open stderr from /dev/null (%s)\n",
strerror(errno)); strerror(errno));
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
if (debug) if (debug)
{ {
@ -4560,7 +4560,7 @@ printf(
"127.0.0.1 - you need to change the 'MAX_IFACE' constant in gdomap.c and " "127.0.0.1 - you need to change the 'MAX_IFACE' constant in gdomap.c and "
"rebuild it."); "rebuild it.");
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
} }
@ -4581,7 +4581,7 @@ printf(
{ {
sprintf(ebuf, "Unable to open pid file - '%s'", pidfile); sprintf(ebuf, "Unable to open pid file - '%s'", pidfile);
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(1); exit(EXIT_FAILURE);
} }
fprintf(fptr, "%d\n", (int) getpid()); fprintf(fptr, "%d\n", (int) getpid());
fclose(fptr); fclose(fptr);

View file

@ -52,7 +52,7 @@ main(int argc, char** argv, char **env)
{ {
NSLog(@"plmerge: unable to get process information!"); NSLog(@"plmerge: unable to get process information!");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
args = [procinfo arguments]; args = [procinfo arguments];
@ -62,7 +62,7 @@ main(int argc, char** argv, char **env)
GSPrintf(stderr, @"Usage: %@ input-file [destination-file]\n", GSPrintf(stderr, @"Usage: %@ input-file [destination-file]\n",
[procinfo processName]); [procinfo processName]);
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
sourceName = [args objectAtIndex: 1]; sourceName = [args objectAtIndex: 1];
@ -92,7 +92,7 @@ main(int argc, char** argv, char **env)
GSPrintf(stderr, GSPrintf(stderr,
@"The source property list must contain an NSDictionary.\n"); @"The source property list must contain an NSDictionary.\n");
[pool release]; [pool release];
exit(1); exit(EXIT_FAILURE);
} }
fileContents = [NSMutableString stringWithCapacity: 200]; fileContents = [NSMutableString stringWithCapacity: 200];
@ -153,5 +153,5 @@ main(int argc, char** argv, char **env)
GSPrintf(stderr, @"Error writing property list to '%@'\n", destName); GSPrintf(stderr, @"Error writing property list to '%@'\n", destName);
} }
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }

View file

@ -48,7 +48,7 @@ main(int argc, char** argv, char **env)
{ {
NSLog(@"pldes: unable to get process information!\n"); NSLog(@"pldes: unable to get process information!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
args = [proc arguments]; args = [proc arguments];

View file

@ -48,7 +48,7 @@ main(int argc, char** argv, char **env)
{ {
NSLog(@"plmerge: unable to get process information!"); NSLog(@"plmerge: unable to get process information!");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
args = [procinfo arguments]; args = [procinfo arguments];
@ -58,7 +58,7 @@ main(int argc, char** argv, char **env)
GSPrintf(stderr, @"Usage: %@ [destination-file] [input-file ...]\n", GSPrintf(stderr, @"Usage: %@ [destination-file] [input-file ...]\n",
[procinfo processName]); [procinfo processName]);
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
destName = [args objectAtIndex: 1]; destName = [args objectAtIndex: 1];
@ -81,7 +81,7 @@ main(int argc, char** argv, char **env)
GSPrintf(stderr, GSPrintf(stderr,
@"The destination property list must contain an NSDictionary.\n"); @"The destination property list must contain an NSDictionary.\n");
[pool release]; [pool release];
exit(1); exit(EXIT_FAILURE);
} }
} }
else else
@ -131,5 +131,5 @@ main(int argc, char** argv, char **env)
GSPrintf(stderr, @"Error writing property list to '%@'\n", destName); GSPrintf(stderr, @"Error writing property list to '%@'\n", destName);
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }

View file

@ -47,7 +47,7 @@ main(int argc, char** argv, char **env)
{ {
NSLog(@"plparse: unable to get process information!\n"); NSLog(@"plparse: unable to get process information!\n");
[pool release]; [pool release];
exit(1); exit(EXIT_FAILURE);
} }
args = [proc arguments]; args = [proc arguments];

View file

@ -48,7 +48,7 @@ main(int argc, char** argv, char **env)
{ {
NSLog(@"plser: unable to get process information!\n"); NSLog(@"plser: unable to get process information!\n");
[pool release]; [pool release];
exit(0); exit(EXIT_SUCCESS);
} }
args = [proc arguments]; args = [proc arguments];

View file

@ -118,7 +118,7 @@ main(int argc, char** argv, char **env)
{ {
GSPrintf(stderr, @"defaults: unable to get process information!\n"); GSPrintf(stderr, @"defaults: unable to get process information!\n");
[pool release]; [pool release];
exit(1); exit(EXIT_FAILURE);
} }
args = [proc arguments]; args = [proc arguments];

View file

@ -72,14 +72,14 @@ main(int argc, char **argv, char **env)
NSLog(@"ERROR: The GNUstep Base Library was built\n" NSLog(@"ERROR: The GNUstep Base Library was built\n"
@" without an available libxml library. xmlparse needs the libxml\n" @" without an available libxml library. xmlparse needs the libxml\n"
@" library to function. Aborting"); @" library to function. Aborting");
exit(1); exit(EXIT_FAILURE);
#endif #endif
proc = [NSProcessInfo processInfo]; proc = [NSProcessInfo processInfo];
if (proc == nil) if (proc == nil)
{ {
NSLog(@"unable to get process information!"); NSLog(@"unable to get process information!");
exit(1); exit(EXIT_FAILURE);
} }
files = [proc arguments]; files = [proc arguments];