#define PTR_TO_FD(p) (PTR_TO_INT(p)-1)
FDSet *fdset_new(void) {
- return MAKE_FDSET(set_new(trivial_hash_func, trivial_compare_func));
+ return MAKE_FDSET(set_new(NULL));
}
void fdset_free(FDSet *s) {
r = fdset_put(s, copy);
if (r < 0) {
- close_nointr_nofail(copy);
+ safe_close(copy);
return r;
}
}
int fdset_new_fill(FDSet **_s) {
- DIR *d;
+ _cleanup_closedir_ DIR *d = NULL;
struct dirent *de;
int r = 0;
FDSet *s;
s = NULL;
finish:
- closedir(d);
-
/* We won't close the fds here! */
if (s)
set_free(MAKE_SET(s));