.BR \-h , " \-\-help"
Display help text and exit.
.SH EXIT STATUS
-Zero if the directory or file is a mountpoint, non-zero if not.
+.B mountpoint
+has the following exit status values:
+.TP
+.B 0
+success; the directory is a mountpoint, or device is block device on \fB\-\-devno\fR
+.TP
+.B 1
+failure; incorrect invocation, permissions or system error
+.TP
+.B 32
+failure; the directory is not a mountpoint, or device is not a block device on \fB\-\-devno\fR
.SH ENVIRONMENT
.IP LIBMOUNT_DEBUG=all
enables libmount debug output.
#include "closestream.h"
#include "pathnames.h"
+#define MOUNTPOINT_EXIT_NOMNT 32
+
struct mountpoint_control {
char *path;
dev_t dev;
return EXIT_FAILURE;
}
if (ctl.dev_devno)
- return print_devno(&ctl) ? EXIT_FAILURE : EXIT_SUCCESS;
+ return print_devno(&ctl) ? MOUNTPOINT_EXIT_NOMNT : EXIT_SUCCESS;
+
if ((ctl.nofollow && S_ISLNK(ctl.st.st_mode)) || dir_to_device(&ctl)) {
if (!ctl.quiet)
printf(_("%s is not a mountpoint\n"), ctl.path);
- return EXIT_FAILURE;
+ return MOUNTPOINT_EXIT_NOMNT;
}
if (ctl.fs_devno)
printf("%u:%u\n", major(ctl.dev), minor(ctl.dev));
else if (!ctl.quiet)
printf(_("%s is a mountpoint\n"), ctl.path);
+
return EXIT_SUCCESS;
}