~ubuntu-branches/ubuntu/jaunty/apache2/jaunty-proposed

« back to all changes in this revision

Viewing changes to srclib/apr/shmem/unix/shm.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2008-12-15 00:06:50 UTC
  • mfrom: (14.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20081215000650-5ovq2vvvrtmn5r1l
Tags: 2.2.11-1ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/{control, rules}: enable PIE hardening.
  - debian/{control, rules, apache2.2-common.ufw.profile}: add ufw profiles.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        if (munmap(m->base, m->realsize) == -1) {
50
50
            return errno;
51
51
        }
52
 
        return apr_file_remove(m->filename, m->pool);
 
52
        if (access(m->filename, F_OK)) {
 
53
            return APR_SUCCESS;
 
54
        }
 
55
        else {
 
56
            return apr_file_remove(m->filename, m->pool);
 
57
        }
53
58
#endif
54
59
#if APR_USE_SHMEM_MMAP_SHM
55
60
        if (munmap(m->base, m->realsize) == -1) {
64
69
        /* Indicate that the segment is to be destroyed as soon
65
70
         * as all processes have detached. This also disallows any
66
71
         * new attachments to the segment. */
67
 
        if (shmctl(m->shmid, IPC_RMID, NULL) == -1) {
 
72
        if (shmctl(m->shmid, IPC_RMID, NULL) == -1 && errno != EINVAL) {
68
73
            return errno;
69
74
        }
70
75
        if (shmdt(m->base) == -1) {
71
76
            return errno;
72
77
        }
73
 
        return apr_file_remove(m->filename, m->pool);
 
78
        if (access(m->filename, F_OK)) {
 
79
            return APR_SUCCESS;
 
80
        }
 
81
        else {
 
82
            return apr_file_remove(m->filename, m->pool);
 
83
        }
74
84
#endif
75
85
    }
76
86