소스 검색

spawn: reduce 2 lines, change fprintf() + perror() + exit() to die("... :")

when calling die and the last character of the string corresponds to
':', die() will call perror(). See util.c

Also change EXIT_SUCCESS to EXIT_FAILURE
explosion-mental 3 년 전
부모
커밋
5b2e5e7a40
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      dwm.c

+ 1 - 3
dwm.c

@@ -1653,9 +1653,7 @@ spawn(const Arg *arg)
 			close(ConnectionNumber(dpy));
 		setsid();
 		execvp(((char **)arg->v)[0], (char **)arg->v);
-		fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]);
-		perror(" failed");
-		exit(EXIT_SUCCESS);
+		die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]);
 	}
 }