- if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0)
- die("glob() failed\n");
- if (globbuf.gl_pathc == 0) {
- /* No glob matches, the specified path does not contain a wildcard. */
- globfree(&globbuf);
- if (!slurp(path, pidbuf, sizeof(pidbuf)))
- return false;
- return (kill(strtol(pidbuf, NULL, 10), 0) == 0 || errno == EPERM);
+ if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0)
+ die("glob() failed\n");
+ if (globbuf.gl_pathc == 0) {
+ /* No glob matches, the specified path does not contain a wildcard. */
+ globfree(&globbuf);
+ if (!slurp(path, pidbuf, sizeof(pidbuf)))
+ return false;
+ return (kill(strtol(pidbuf, NULL, 10), 0) == 0 || errno == EPERM);
+ }
+ for (size_t i = 0; i < globbuf.gl_pathc; i++) {
+ if (!slurp(globbuf.gl_pathv[i], pidbuf, sizeof(pidbuf))) {
+ globfree(&globbuf);
+ return false;