[PATCH] mount.cifs: make return codes match the return codes for /bin/mount (try #2)

Jeff Moyer jmoyer at redhat.com
Wed Oct 8 18:26:07 GMT 2008


Jeff Layton <jlayton at redhat.com> writes:

> The manpage for /bin/mount specifies that the return code should be a
> positive integer (actually, it's a bitfield). Clean up the return
> codes from mount.cifs to make them match the expected return values
> from /bin/mount. This necessary for proper integration with autofs.
>
> This is the second attempt at this patch. The main difference here
> is that this one uses #define'd constants for the exit codes. I
> also changed a few places to return EX_SYSERR rather than EX_USAGE
> since it looked like a more appropriate error.
>
> Signed-off-by: Jeff Layton <jlayton at redhat.com>

Well, I don't like the mixed exit()s and return's, but that was there
before.  There's also the question of whether you really want to return
the same error code for all of the below cases:

        if(mount(dev_name, mountpoint, "cifs", flags, options)) {
                case 0:
                case ENODEV:
                case ENXIO:
                default:

But again, that was already there.  If folks find those things
palatable, then I'm okay with this.  I guess it's worth noting that I am
somewhat familiar with the mount code, and I believe this is exactly
what it expects, since it just returns the exit status of the
fs-specific mount command in the failure case.

Acked-by: Jeff Moyer <jmoyer at redhat.com>

Cheers,

Jeff


More information about the samba-technical mailing list