Commit 7b535647 authored by Mike Hibler's avatar Mike Hibler

Nit: add missing newlines to various error messages.

parent 2fbfc5dd
/* /*
* Copyright (c) 2000-2013 University of Utah and the Flux Group. * Copyright (c) 2000-2014 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -135,16 +135,16 @@ event_register_withkeyfile_withretry(char *name, int threaded, ...@@ -135,16 +135,16 @@ event_register_withkeyfile_withretry(char *name, int threaded,
int cc; int cc;
if ((fp = fopen(keyfile, "r")) == NULL) { if ((fp = fopen(keyfile, "r")) == NULL) {
ERROR("could not open keyfile: %s", keyfile); ERROR("could not open keyfile: %s\n", keyfile);
return 0; return 0;
} }
if ((cc = fread(buf, sizeof(char), sizeof(buf), fp)) == 0) { if ((cc = fread(buf, sizeof(char), sizeof(buf), fp)) == 0) {
ERROR("could not read keyfile: %s", keyfile); ERROR("could not read keyfile: %s\n", keyfile);
fclose(fp); fclose(fp);
return 0; return 0;
} }
if (cc == sizeof(buf)) { if (cc == sizeof(buf)) {
ERROR("keyfile is too big: %s", keyfile); ERROR("keyfile is too big: %s\n", keyfile);
fclose(fp); fclose(fp);
return 0; return 0;
} }
...@@ -214,8 +214,12 @@ event_register_withkeydata_withretry(char *name, int threaded, ...@@ -214,8 +214,12 @@ event_register_withkeydata_withretry(char *name, int threaded,
int scanres; int scanres;
FILE *fp; FILE *fp;
ERROR("could not get IP address from hostname, " if (strlen(hostname)) {
"reading IP from %s.\n", IPADDRFILE); ERROR("could not get IP address from hostname");
} else {
ERROR("hostname not set or not fully qualified");
}
fprintf(stderr, ", reading IP from %s.\n", IPADDRFILE);
/* Try getting the node's ID from BOOTDIR/myip before giving up. */ /* Try getting the node's ID from BOOTDIR/myip before giving up. */
fp = fopen(IPADDRFILE, "r"); fp = fopen(IPADDRFILE, "r");
if (fp != NULL) { if (fp != NULL) {
...@@ -231,7 +235,7 @@ event_register_withkeydata_withretry(char *name, int threaded, ...@@ -231,7 +235,7 @@ event_register_withkeydata_withretry(char *name, int threaded,
} }
snprintf(ipaddr, sizeof(ipaddr), "%u.%u.%u.%u", o1, o2, o3, o4); snprintf(ipaddr, sizeof(ipaddr), "%u.%u.%u.%u", o1, o2, o3, o4);
} else { } else {
ERROR("could not get IP from local file %s either!", IPADDRFILE); ERROR("could not get IP from local file %s either!\n", IPADDRFILE);
return 0; return 0;
} }
} }
...@@ -276,7 +280,7 @@ event_register_withkeydata_withretry(char *name, int threaded, ...@@ -276,7 +280,7 @@ event_register_withkeydata_withretry(char *name, int threaded,
sstr = strrchr(cp, '/'); sstr = strrchr(cp, '/');
} }
if (!sstr) { if (!sstr) {
ERROR("could not parse: %s", name); ERROR("could not parse: %s\n", name);
goto bad; goto bad;
} }
*sstr++ = '\0'; *sstr++ = '\0';
...@@ -1191,7 +1195,9 @@ addclause(char *tag, char *clause, char *exp, int size, int *index) ...@@ -1191,7 +1195,9 @@ addclause(char *tag, char *clause, char *exp, int size, int *index)
char *bp; char *bp;
char clausecopy[EXPRESSION_LENGTH], *strp = clausecopy; char clausecopy[EXPRESSION_LENGTH], *strp = clausecopy;
char buf[EXPRESSION_LENGTH]; char buf[EXPRESSION_LENGTH];
#if 0
int needglob = 1; int needglob = 1;
#endif
/* Must copy clause since we use strsep! */ /* Must copy clause since we use strsep! */
if (strlen(clause) >= sizeof(clausecopy)-1) if (strlen(clause) >= sizeof(clausecopy)-1)
...@@ -1208,8 +1214,10 @@ addclause(char *tag, char *clause, char *exp, int size, int *index) ...@@ -1208,8 +1214,10 @@ addclause(char *tag, char *clause, char *exp, int size, int *index)
if (! *bp) if (! *bp)
continue; continue;
#if 0
if (! strcmp("*", bp)) if (! strcmp("*", bp))
needglob = 0; needglob = 0;
#endif
count += snprintf(&buf[count], sizeof(buf) - count, count += snprintf(&buf[count], sizeof(buf) - count,
"%s %s == \"%s\" ", "%s %s == \"%s\" ",
...@@ -2240,7 +2248,7 @@ event_notification_t event_notification_create_v(event_handle_t handle, ...@@ -2240,7 +2248,7 @@ event_notification_t event_notification_create_v(event_handle_t handle,
address_tuple_t tuple; address_tuple_t tuple;
if ((tuple = address_tuple_alloc()) == NULL) { if ((tuple = address_tuple_alloc()) == NULL) {
ERROR("could not allocate address tuple"); ERROR("could not allocate address tuple\n");
errno = ENOMEM; errno = ENOMEM;
} }
else { else {
...@@ -2304,7 +2312,7 @@ event_notification_t event_notification_create_v(event_handle_t handle, ...@@ -2304,7 +2312,7 @@ event_notification_t event_notification_create_v(event_handle_t handle,
when = va_arg(args, struct timeval *); when = va_arg(args, struct timeval *);
break; break;
default: default:
ERROR("unknown tag value"); ERROR("unknown tag value\n");
errno = EINVAL; errno = EINVAL;
return 0; return 0;
} }
...@@ -2313,7 +2321,7 @@ event_notification_t event_notification_create_v(event_handle_t handle, ...@@ -2313,7 +2321,7 @@ event_notification_t event_notification_create_v(event_handle_t handle,
if ((retval = event_notification_alloc(handle, if ((retval = event_notification_alloc(handle,
tuple)) == NULL) { tuple)) == NULL) {
ERROR("could not allocate notification"); ERROR("could not allocate notification\n");
errno = ENOMEM; errno = ENOMEM;
} }
else { else {
...@@ -2355,7 +2363,7 @@ int event_do_v(event_handle_t handle, ea_tag_t tag, va_list args) ...@@ -2355,7 +2363,7 @@ int event_do_v(event_handle_t handle, ea_tag_t tag, va_list args)
if ((en = event_notification_create_v(handle, &when, if ((en = event_notification_create_v(handle, &when,
tag, args)) == NULL) { tag, args)) == NULL) {
ERROR("could not allocate notification"); ERROR("could not allocate notification\n");
errno = ENOMEM; errno = ENOMEM;
} }
else { else {
......
/* /*
* Copyright (c) 2000-2013 University of Utah and the Flux Group. * Copyright (c) 2000-2014 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -60,18 +60,18 @@ bootinfo_init(void) ...@@ -60,18 +60,18 @@ bootinfo_init(void)
/* Initialize data base */ /* Initialize data base */
err = open_bootinfo_db(); err = open_bootinfo_db();
if (err) { if (err) {
error("could not open database"); error("could not open database\n");
return -1; return -1;
} }
err = bicache_init(); err = bicache_init();
if (err) { if (err) {
error("could not initialize cache"); error("could not initialize cache\n");
return -1; return -1;
} }
#ifdef EVENTSYS #ifdef EVENTSYS
err = bievent_init(); err = bievent_init();
if (err) { if (err) {
error("could not initialize event system"); error("could not initialize event system\n");
return -1; return -1;
} }
#endif #endif
......
/* /*
* Copyright (c) 2000-2003 University of Utah and the Flux Group. * Copyright (c) 2000-2014 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -102,7 +102,7 @@ parse_host(char *name) ...@@ -102,7 +102,7 @@ parse_host(char *name)
if (!isdigit(name[0])) { if (!isdigit(name[0])) {
he = gethostbyname(name); he = gethostbyname(name);
if (he == 0) { if (he == 0) {
error("%s: unknown host", name); error("%s: unknown host\n", name);
return 0; return 0;
} }
return *(int *)he->h_addr; return *(int *)he->h_addr;
...@@ -121,7 +121,7 @@ parse_configs(char *filename) ...@@ -121,7 +121,7 @@ parse_configs(char *filename)
int ipaddr; int ipaddr;
if ((fp = fopen(filename, "r")) == NULL) { if ((fp = fopen(filename, "r")) == NULL) {
error("%s: cannot open", filename); error("%s: cannot open\n", filename);
return 1; return 1;
} }
...@@ -133,7 +133,7 @@ parse_configs(char *filename) ...@@ -133,7 +133,7 @@ parse_configs(char *filename)
continue; continue;
if (numconfigs >= MAX_CONFIGS) { if (numconfigs >= MAX_CONFIGS) {
error("%s: too many lines", filename); error("%s: too many lines\n", filename);
fclose(fp); fclose(fp);
return 1; return 1;
} }
...@@ -143,7 +143,7 @@ parse_configs(char *filename) ...@@ -143,7 +143,7 @@ parse_configs(char *filename)
configp = (struct config *) calloc(sizeof *configp, 1); configp = (struct config *) calloc(sizeof *configp, 1);
if (!configp) { if (!configp) {
bad: bad:
error("%s: parse error", filename); error("%s: parse error\n", filename);
fclose(fp); fclose(fp);
close_bootinfo_db(); close_bootinfo_db();
return 1; return 1;
......
/* /*
* Copyright (c) 2000-2012 University of Utah and the Flux Group. * Copyright (c) 2000-2014 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -121,13 +121,13 @@ main(int argc, char **argv) ...@@ -121,13 +121,13 @@ main(int argc, char **argv)
err = open_bootinfo_db(); err = open_bootinfo_db();
if (err) { if (err) {
error("could not open database"); error("could not open database\n");
exit(1); exit(1);
} }
#ifdef EVENTSYS #ifdef EVENTSYS
err = bievent_init(); err = bievent_init();
if (err) { if (err) {
error("could not initialize event system"); error("could not initialize event system\n");
exit(1); exit(1);
} }
#endif #endif
......
/* /*
* Copyright (c) 2000-2004, 2007 University of Utah and the Flux Group. * Copyright (c) 2000-2014 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -118,7 +118,7 @@ bievent_send(struct in_addr ipaddr, void *opaque, char *event) ...@@ -118,7 +118,7 @@ bievent_send(struct in_addr ipaddr, void *opaque, char *event)
info("Sending event %s for node %s\n", event, nodeid); info("Sending event %s for node %s\n", event, nodeid);
if (event_notify(event_handle, notification) == 0) { if (event_notify(event_handle, notification) == 0) {
error("Unable to send notification!"); error("Unable to send notification!\n");
event_notification_free(event_handle, notification); event_notification_free(event_handle, notification);
/* /*
......
/* /*
* Copyright (c) 2000-2012 University of Utah and the Flux Group. * Copyright (c) 2000-2014 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -131,7 +131,7 @@ main(int argc, char **argv) ...@@ -131,7 +131,7 @@ main(int argc, char **argv)
err = bootinfo_init(); err = bootinfo_init();
if (err) { if (err) {
error("could not initialize bootinfo"); error("could not initialize bootinfo\n");
exit(1); exit(1);
} }
/* Create socket from which to read. */ /* Create socket from which to read. */
...@@ -198,7 +198,7 @@ onhup(int sig) ...@@ -198,7 +198,7 @@ onhup(int sig)
close_bootinfo_db(); close_bootinfo_db();
err = open_bootinfo_db(); err = open_bootinfo_db();
if (err) { if (err) {
error("Could not reopen database"); error("Could not reopen database\n");
exit(1); exit(1);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment