Print errors to stderr
A lot of error reporting used a simple `printf` call which by default prints to stdout. This was changed so that all error reporting is done by an `fprintf(stderr, ...)` call.
This commit is contained in:
parent
fccdce0819
commit
37628f3dc4
@ -94,7 +94,7 @@ void handle_method_call(GDBusConnection * connection,
|
||||
on_get_server_information(connection, sender, parameters,
|
||||
invocation);
|
||||
} else {
|
||||
printf("WARNING: sender: %s; unknown method_name: %s\n", sender,
|
||||
fprintf(stderr, "WARNING: sender: %s; unknown method_name: %s\n", sender,
|
||||
method_name);
|
||||
}
|
||||
}
|
||||
@ -354,7 +354,7 @@ static void on_get_server_information(GDBusConnection * connection,
|
||||
void notification_closed(notification * n, int reason)
|
||||
{
|
||||
if (!dbus_conn) {
|
||||
printf("DEBUG: notification_closed but not (yet) connected\n");
|
||||
fprintf(stderr, "ERROR: notification_closed but not (yet) connected\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -368,7 +368,7 @@ void notification_closed(notification * n, int reason)
|
||||
"NotificationClosed", body, &err);
|
||||
|
||||
if (err) {
|
||||
printf("notification_closed ERROR\n");
|
||||
fprintf(stderr, "notification_closed ERROR\n");
|
||||
}
|
||||
|
||||
}
|
||||
@ -385,7 +385,7 @@ void action_invoked(notification * n, const char *identifier)
|
||||
"ActionInvoked", body, &err);
|
||||
|
||||
if (err) {
|
||||
printf("ActionInvoked ERROR\n");
|
||||
fprintf(stderr, "ActionInvoked ERROR\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,10 +223,10 @@ int load_ini_file(FILE * fp)
|
||||
if (*start == '[') {
|
||||
char *end = strchr(start + 1, ']');
|
||||
if (!end) {
|
||||
printf
|
||||
("Warning: invalid config file at line %d\n",
|
||||
fprintf(stderr,
|
||||
"Warning: invalid config file at line %d\n",
|
||||
line_num);
|
||||
printf("Missing ']'\n");
|
||||
fprintf(stderr, "Missing ']'\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -241,9 +241,10 @@ int load_ini_file(FILE * fp)
|
||||
|
||||
char *equal = strchr(start + 1, '=');
|
||||
if (!equal) {
|
||||
printf("Warning: invalid config file at line %d\n",
|
||||
fprintf(stderr,
|
||||
"Warning: invalid config file at line %d\n",
|
||||
line_num);
|
||||
printf("Missing '='\n");
|
||||
fprintf(stderr, "Missing '='\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -255,10 +256,10 @@ int load_ini_file(FILE * fp)
|
||||
if (quote) {
|
||||
char *closing_quote = strchr(quote + 1, '"');
|
||||
if (!closing_quote) {
|
||||
printf
|
||||
("Warning: invalid config file at line %d\n",
|
||||
fprintf(stderr,
|
||||
"Warning: invalid config file at line %d\n",
|
||||
line_num);
|
||||
printf("Missing '\"'\n");
|
||||
fprintf(stderr, "Missing '\"'\n");
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
@ -269,9 +270,10 @@ int load_ini_file(FILE * fp)
|
||||
value = g_strstrip(value);
|
||||
|
||||
if (!current_section) {
|
||||
printf("Warning: invalid config file at line: %d\n",
|
||||
fprintf(stderr,
|
||||
"Warning: invalid config file at line: %d\n",
|
||||
line_num);
|
||||
printf("Key value pair without a section\n");
|
||||
fprintf(stderr, "Key value pair without a section\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user