possibly fix 'too many open files', but unlikely

This commit is contained in:
speedie 2022-12-14 19:13:43 +01:00
parent 236041f001
commit ac35797f94

View file

@ -5418,7 +5418,6 @@ sortscreens(XineramaScreenInfo *screens, int n)
void
spawn(const Arg *arg)
{
FILE *buttonfile = fopen("/tmp/speedwm-button", "w");
if (fork() == 0) {
if (dpy)
close(ConnectionNumber(dpy));
@ -5430,6 +5429,9 @@ spawn(const Arg *arg)
/* compatibility with dwm bars */
setenv("BUTTON", lastbutton, 1);
FILE *buttonfile = fopen("/tmp/speedwm-button", "w");
int writestatus = fputs(lastbutton, buttonfile);
if (writestatus == EOF) {
fprintf(stderr, "speedwm: failed to write clickstatus button.\n");