~ecryptfs/ecryptfs/trunk

« back to all changes in this revision

Viewing changes to src/libecryptfs/cmd_ln_parser.c

  • Committer: Michal Hlavinka
  • Date: 2009-04-21 19:50:44 UTC
  • mto: This revision was merged to the branch mainline in revision 377.
  • Revision ID: mhlavink@redhat.com-20090421195044-7jry8c4mgc1zk7jn
change error codes to be more descriptive

Error codes were changed to be more descriptive. MOUNT_ERROR after 
asprintf changed to ENOMEM, some error codes are no longer filtered 
to MOUNT_ERROR. And some other changes mostly from general MOUNT_ERROR
to ESOMETHING.

Signed-off-by: Michal Hlavinka <mhlavink@redhat.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
382
382
                       __FUNCTION__, rc, fd);
383
383
                goto out;
384
384
        }
 
385
        if (S_ISDIR(filestat.st_mode)) {
 
386
                rc = -EISDIR;
 
387
                goto out;
 
388
        }
385
389
        pagesize = getpagesize();
386
390
        file_size = filestat.st_size;
387
391
        if (file_size > MAX_FILE_SIZE) {
388
392
                syslog(LOG_ERR, "File size too large\n");
389
 
                rc = -1;
 
393
                rc = -EFBIG;
390
394
                goto out;
391
395
        }
392
396
        if (file_size % pagesize) {
395
399
        }
396
400
        data = mmap((caddr_t)0, file_size, PROT_READ, MAP_PRIVATE, fd, 0);
397
401
        if (data == MAP_FAILED) {
398
 
                rc = errno;
 
402
                rc = -errno;
399
403
                syslog(LOG_ERR, "%s: mmap failed on fd [%d]; rc = [%d]\n",
400
404
                       __FUNCTION__, fd, rc);
401
405
                goto out;