Remove the early exit: we always process all of the entries now. The
socket is `STALE' if we can't find any entries.
goto done;
if (!fgets(buf, sizeof(buf), fp)) goto done; /* skip header */
len = strlen(sun->sun_path);
+ rc = 0;
while (fgets(buf, sizeof(buf), fp)) {
n = strlen(buf);
if (n >= len + 2 && buf[n - len - 2] == ' ' && buf[n - 1] == '\n' &&
- memcmp(buf + n - len - 1, sun->sun_path, len) == 0)
- goto done;
+ memcmp(buf + n - len - 1, sun->sun_path, len) == 0) {
+ rc |= USED;
+ }
}
if (ferror(fp))
goto done;
- rc = STALE;
+ if (!rc) rc = STALE;
done:
if (fp) fclose(fp);