MCPcopy Create free account
hub / github.com/coreutils/coreutils / automount_stat_err

Function automount_stat_err

src/df.c:280–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278 trigger automounts. */
279
280static int
281automount_stat_err (char const *file, struct stat *st)
282{
283 int fd = open (file, O_RDONLY | O_NOCTTY | O_NONBLOCK);
284 if (fd < 0)
285 {
286 if (errno == ENOENT || errno == ENOTDIR)
287 return errno;
288 return stat (file, st) == 0 ? 0 : errno;
289 }
290 else
291 {
292 int err = fstat (fd, st) == 0 ? 0 : errno;
293 close (fd);
294 return err;
295 }
296}
297
298enum { MBSWIDTH_FLAGS = MBSW_REJECT_INVALID | MBSW_REJECT_UNPRINTABLE };
299

Callers 1

mainFunction · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected