View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0009309 | GNUnet | util library | public | 2024-11-01 15:00 | 2024-11-14 09:43 |
Reporter | fefe | Assigned To | schanzen | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Target Version | 0.23.0 | ||||
Summary | 0009309: GNUNET_DISK_directory_scan: get rid of the stat() call | ||||
Description | 835 if (0 != stat (dname, &istat)) 836 { 837 LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "stat", dname); 838 GNUNET_free (dname); 839 return GNUNET_SYSERR; 840 } 841 if (! S_ISDIR (istat.st_mode)) 842 { 843 LOG (GNUNET_ERROR_TYPE_WARNING, 844 _ ("Expected `%s' to be a directory!\n"), 845 dir_name); 846 GNUNET_free (dname); 847 return GNUNET_SYSERR; 848 } 849 errno = 0; 850 dinfo = opendir (dname); 851 if ((EACCES == errno) || (NULL == dinfo)) 852 { The stat is superfluous. If dname is not a directory, opendir returns NULL and sets errno to ENOTDIR. Also the errno acrobatics look bad. Just call opendir and if it returns NULL then look at errno. | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2024-11-01 15:00 | fefe | New Issue | |
2024-11-03 20:34 | schanzen | Target Version | => 0.22.3 |
2024-11-04 10:53 | schanzen | Changeset attached | => gnunet master bf7076ea |
2024-11-04 10:53 | schanzen | Note Added: 0023652 | |
2024-11-04 10:53 | schanzen | Assigned To | => schanzen |
2024-11-04 10:53 | schanzen | Status | new => resolved |
2024-11-04 10:53 | schanzen | Resolution | open => fixed |
2024-11-14 09:43 | schanzen | Target Version | 0.22.3 => 0.23.0 |