diff options
Diffstat (limited to 'dwmclock.c')
-rw-r--r-- | dwmclock.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -91,11 +91,19 @@ int main(void) sigaction(SIGQUIT, &act, NULL); sigaction(SIGTERM, &act, NULL); - disp = XOpenDisplay(NULL); + if (!(disp = XOpenDisplay(NULL))) { + return EXIT_FAILURE; + } screen = DefaultScreen(disp); - root = RootWindow(disp, screen); + if (!(root = RootWindow(disp, screen))) { + return EXIT_FAILURE; + } XFetchName(disp, root, &origname); + fclose(stdin); + fclose(stdout); + fclose(stderr); + #ifdef BATTERY for (i=0; !stop; ++i) { #else @@ -155,5 +163,5 @@ int main(void) } XCloseDisplay(disp); - return 0; + return EXIT_SUCCESS; } |