Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | The local function eaccess conflicts with a glibc function of the same name. |
| 2 | Rename the function so that this can be build under glibc 2.4, and older |
| 3 | revisions, without any problems. |
| 4 | |
| 5 | --- liblockfile-1.06/dotlockfile.c 2006/07/10 03:17:40 1.1 |
| 6 | +++ liblockfile-1.06/dotlockfile.c 2006/07/10 03:18:26 |
| 7 | @@ -42,7 +42,7 @@ |
| 8 | extern int optind; |
| 9 | #endif |
| 10 | |
| 11 | -extern int eaccess(char *, gid_t, struct stat *); |
| 12 | +extern int xeaccess(char *, gid_t, struct stat *); |
| 13 | |
| 14 | /* |
| 15 | * Sleep for an amout of time while regulary checking if |
| 16 | @@ -252,14 +252,14 @@ |
| 17 | return L_ERROR; |
| 18 | } |
| 19 | gid = getgid(); |
| 20 | - if (eaccess(dir, gid, &st) < 0) { |
| 21 | + if (xeaccess(dir, gid, &st) < 0) { |
| 22 | if (errno == ENOENT) { |
| 23 | enoent: |
| 24 | if (!quiet) fprintf(stderr, |
| 25 | "dotlockfile: %s: no such directory\n", dir); |
| 26 | return L_TMPLOCK; |
| 27 | } |
| 28 | - if ((r = eaccess(dir, getegid(), &st) < 0) && errno == ENOENT) |
| 29 | + if ((r = xeaccess(dir, getegid(), &st) < 0) && errno == ENOENT) |
| 30 | goto enoent; |
| 31 | if (r < 0 || !ismaillock(lockfile, pwd->pw_name)) { |
| 32 | if (!quiet) fprintf(stderr, |
| 33 | @@ -272,7 +272,7 @@ |
| 34 | /* |
| 35 | * Now we should be able to chdir() to the lock directory. |
| 36 | * When we stat("."), it should be the same as at the |
| 37 | - * eaccess() check or someone played symlink() games on us. |
| 38 | + * xeaccess() check or someone played symlink() games on us. |
| 39 | */ |
| 40 | if (chdir(dir) < 0 || stat(".", &st2) < 0) { |
| 41 | if (!quiet) fprintf(stderr, |
| 42 | --- liblockfile-1.06/lockfile.c 2006/07/10 03:17:40 1.1 |
| 43 | +++ liblockfile-1.06/lockfile.c 2006/07/10 03:18:26 |
| 44 | @@ -54,7 +54,7 @@ |
| 45 | #ifdef LIB |
| 46 | static |
| 47 | #endif |
| 48 | -int eaccess(char *fn, gid_t gid, struct stat *st) |
| 49 | +int xeaccess(char *fn, gid_t gid, struct stat *st) |
| 50 | { |
| 51 | struct stat tmp; |
| 52 | uid_t uid = geteuid(); |
| 53 | @@ -96,7 +96,7 @@ |
| 54 | *p = 0; |
| 55 | else |
| 56 | strcpy(dir, "."); |
| 57 | - if (eaccess(dir, egid, NULL) >= 0) { |
| 58 | + if (xeaccess(dir, egid, NULL) >= 0) { |
| 59 | free(dir); |
| 60 | return 0; |
| 61 | } |
| 62 | @@ -111,7 +111,7 @@ |
| 63 | return 0; |
| 64 | mailgid = st.st_gid; |
| 65 | } |
| 66 | - ret = eaccess(dir, mailgid, NULL) >= 0; |
| 67 | + ret = xeaccess(dir, mailgid, NULL) >= 0; |
| 68 | free (dir); |
| 69 | return ret; |
| 70 | } |