~ubuntu-branches/debian/jessie/netatalk/jessie

« back to all changes in this revision

Viewing changes to etc/afpd/fce_util.c

  • Committer: Package Import Robot
  • Author(s): Jonas Smedegaard
  • Date: 2012-03-20 23:37:08 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120320233708-sp2k0av7f9sjnf4w
Tags: 2.2.2-1
* New upstream release.
* Drop patch cherry-picked upstream: Included in new upstream release.
* Build-depend on libldap2-dev and libacl1-dev, to enable LDAP support
  and support for extended ACLs (and possibly avoid FTBFS).
  Closes: bug#645290, #651406. Thanks to Peter Eisentraut and masc.
* Update copyright file:
  + Bump format to 1.0.
  + Fix double-indent in Copyright fields as per Policy §5.6.13.
  + Add Files paragraph for ACL code.
* Bump standards-version to 3.9.3.
* Update copyright file: Add disclaimer to License paragraph
  GAP~Makefile.in.
* Bump debhelper compat level to 7.
* Add patch 101 to start avahi-daemon (if available) before atalkd.
  Recommend avahi-daemon.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#endif /* HAVE_CONFIG_H */
25
25
 
26
26
#include <stdio.h>
27
 
 
28
27
#include <string.h>
29
28
#include <stdlib.h>
30
29
#include <errno.h>
31
30
#include <time.h>
32
 
 
33
 
 
 
31
#include <stdbool.h>
34
32
#include <sys/param.h>
35
33
#include <sys/socket.h>
36
34
#include <netinet/in.h>
96
94
        }
97
95
}
98
96
 
99
 
int fce_handle_coalescation( char *path, int is_dir, int mode )
 
97
bool fce_handle_coalescation( char *path, int is_dir, int mode )
100
98
{
101
99
        /* These two are used to eval our next index in history */
102
100
        /* the history is unsorted, speed should not be a problem, length is 10 */
105
103
        struct timeval tv;
106
104
 
107
105
        if (coalesce == 0)
108
 
                return FALSE;
 
106
                return false;
109
107
 
110
108
        /* After a file creation *ALWAYS* a file modification is produced */
111
109
        if ((mode == FCE_FILE_CREATE) && (coalesce & FCE_COALESCE_CREATE))
112
 
        return TRUE;
 
110
        return true;
113
111
 
114
112
        /* get timestamp */
115
113
        gettimeofday(&tv, 0);
140
138
                if ((coalesce & FCE_COALESCE_CREATE) && (fh->mode == FCE_DIR_CREATE)) {
141
139
                        /* Parent dir ? */
142
140
                        if (!strncmp(fh->path, path, strlen(fh->path)))
143
 
                                return TRUE;
 
141
                                return true;
144
142
                }
145
143
 
146
144
                /* If we find a parent dir we should be DELETED we are done */
149
147
            && (mode == FCE_FILE_DELETE || mode == FCE_DIR_DELETE)) {
150
148
                        /* Parent dir ? */
151
149
                        if (!strncmp(fh->path, path, strlen(fh->path)))
152
 
                                return TRUE;
 
150
                                return true;
153
151
                }
154
152
 
155
153
                /* Detect oldest entry for next new entry */
166
164
        strncpy( fce_history_list[oldest_entry_idx].path, path, MAXPATHLEN);
167
165
 
168
166
        /* we have to handle this event */
169
 
        return FALSE;
 
167
        return false;
170
168
}
171
169
 
172
170
/*
195
193
    }
196
194
 
197
195
    free(e);
 
196
 
 
197
    return AFP_OK;
198
198
}
199
199
 
200
200