summaryrefslogtreecommitdiff
path: root/src/sxwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sxwm.c')
-rw-r--r--src/sxwm.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/sxwm.c b/src/sxwm.c
index fb13f55..8a16b11 100644
--- a/src/sxwm.c
+++ b/src/sxwm.c
@@ -1108,7 +1108,7 @@ void hdl_map_req(XEvent *xev)
}
if (open_windows == MAX_CLIENTS) {
- printf("sxwm: max clients reached, ignoring map request\n");
+ fprintf(stderr, "sxwm: max clients reached, ignoring map request\n");
return;
}
@@ -1460,13 +1460,13 @@ Bool is_child_proc(pid_t parent_pid, pid_t child_pid)
snprintf(path, sizeof(path), "/proc/%d/stat", current_pid);
f = fopen(path, "r");
if (!f) {
- printf("sxwm: could not open %s\n", path);
+ fprintf(stderr, "sxwm: could not open %s\n", path);
return False;
}
int ppid = 0;
if (fscanf(f, "%*d %*s %*c %d", &ppid) != 1) {
- printf("sxwm: failed to read ppid from %s\n", path);
+ fprintf(stderr, "sxwm: failed to read ppid from %s\n", path);
fclose(f);
return False;
}
@@ -1478,7 +1478,7 @@ Bool is_child_proc(pid_t parent_pid, pid_t child_pid)
if (ppid <= 1) {
/* Reached init or kernel */
- printf("sxwm: reached init/kernel, no relationship found\n");
+ fprintf(stderr, "sxwm: reached init/kernel, no relationship found\n");
break;
}
current_pid = ppid;
@@ -1722,7 +1722,7 @@ void quit(void)
XFreeCursor(dpy, cursor_move);
XFreeCursor(dpy, cursor_normal);
XFreeCursor(dpy, cursor_resize);
- printf("quitting...\n");
+ puts("quitting...");
running = False;
}
@@ -3039,7 +3039,7 @@ void xev_case(XEvent *xev)
evtable[xev->type](xev);
}
else {
- printf("sxwm: invalid event type: %d\n", xev->type);
+ fprintf(stderr, "sxwm: invalid event type: %d\n", xev->type);
}
}
@@ -3048,7 +3048,7 @@ int main(int ac, char **av)
if (ac > 1) {
if (strcmp(av[1], "-v") == 0 || strcmp(av[1], "--version") == 0) {
printf("%s\n%s\n%s\n", SXWM_VERSION, SXWM_AUTHOR, SXWM_LICINFO);
- exit(0);
+ return EXIT_SUCCESS;
}
else if (strcmp(av[1], "-b") == 0 || strcmp(av[1], "--backup") == 0) {
puts("sxwm: using backup keybinds");
@@ -3058,11 +3058,11 @@ int main(int ac, char **av)
puts("usage:\n");
puts("\t[-v || --version]: See the version of sxwm\n");
puts("\t[-b || --backup]: Use backup set of keybinds with sxwm\n");
- exit(0);
+ return EXIT_SUCCESS;
}
}
setup();
- printf("sxwm: starting...\n");
+ puts("sxwm: starting...");
run();
- return 0;
+ return EXIT_SUCCESS;
}