- foutput = stderr;
- dpy = XOpenDisplay(0x0);
-
- ARGBEGIN {
- case 'd':
- dflag = 1;
- break;
- case 'l':
- strlcpy(logpath, EARGF(usage()), sizeof(logpath)-1);
- logpath[strlen(logpath)+1] = '\0';
- foutput = fopen(logpath, "a");
- if (foutput == NULL) {
- fprintf(stderr, "failed to open log file at %s: %s\n",
- logpath, strerror(errno));
- return (1);
- }
- lflag = 1;
- break;
- default:
- usage();
- } ARGEND
-
- if (dflag && !lflag) {
- ccat(2, getenv("HOME"), "/.slstatus_log");
- foutput = fopen(concat, "a");
- if (foutput == NULL) {
- fprintf(stderr, "failed to open log file at %s: %s\n",
- logpath, strerror(errno));
- return (1);
- }
- }
-
- if (dflag)
- daemon(0, 0);