| 278 | trigger automounts. */ |
| 279 | |
| 280 | static int |
| 281 | automount_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 | |
| 298 | enum { MBSWIDTH_FLAGS = MBSW_REJECT_INVALID | MBSW_REJECT_UNPRINTABLE }; |
| 299 |