~ubuntu-branches/debian/jessie/ufsutils/jessie

« back to all changes in this revision

Viewing changes to sbin/mount/getmntopts.c

  • Committer: Package Import Robot
  • Author(s): Robert Millan
  • Date: 2014-05-22 18:05:36 UTC
  • mfrom: (11.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20140522180536-nsmuhw6ryv9awr88
Tags: 10.0-3
Fix FTBFS due to missing <libutil.h> by adding a libutil-freebsd-dev
build-dep (Closes: #741088). Thanks Cyril Brulebois.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
#include <stdio.h>
47
47
#include <stdlib.h>
48
48
#include <string.h>
49
 
#include <sysexits.h>
50
49
 
51
50
#include "mntopts.h"
52
51
 
124
123
                *rrpout = '\0';
125
124
}
126
125
 
127
 
void
 
126
int
128
127
checkpath(const char *path, char *resolved)
129
128
{
130
129
        struct stat sb;
131
130
 
132
 
        if (realpath(path, resolved) != NULL && stat(resolved, &sb) == 0) {
133
 
                if (!S_ISDIR(sb.st_mode))
134
 
                        errx(EX_USAGE, "%s: not a directory", resolved);
135
 
        } else
136
 
                errx(EX_USAGE, "%s: %s", resolved, strerror(errno));
 
131
        if (realpath(path, resolved) == NULL || stat(resolved, &sb) != 0)
 
132
                return (1);
 
133
        if (!S_ISDIR(sb.st_mode)) {
 
134
                errno = ENOTDIR;
 
135
                return (1);
 
136
        }
 
137
        return (0);
137
138
}
138
139
 
139
140
void