=== modified file 'debian/changelog' --- debian/changelog 2013-08-29 12:49:24 +0000 +++ debian/changelog 2013-08-30 02:36:48 +0000 @@ -1,9 +1,13 @@ click (0.4.0) UNRELEASED; urgency=low + [ Colin Watson ] * Add "installed-size" as a mandatory field in the control area's "manifest" file; it should not be present in source manifest files, and is generated automatically by "click build". + [ Loïc Minier ] + * Add fopen64. + -- Colin Watson Thu, 29 Aug 2013 13:47:27 +0100 click (0.3.4) saucy; urgency=low === modified file 'preload/clickpreload.c' --- preload/clickpreload.c 2013-07-29 15:38:44 +0000 +++ preload/clickpreload.c 2013-08-30 02:32:26 +0000 @@ -38,6 +38,7 @@ static int (*libc_execvp) (const char *, char * const []) = (void *) 0; static int (*libc_fchown) (int, uid_t, gid_t) = (void *) 0; static FILE *(*libc_fopen) (const char *, const char *) = (void *) 0; +static FILE *(*libc_fopen64) (const char *, const char *) = (void *) 0; static struct group *(*libc_getgrnam) (const char *) = (void *) 0; static struct passwd *(*libc_getpwnam) (const char *) = (void *) 0; static int (*libc_link) (const char *, const char *) = (void *) 0; @@ -76,6 +77,7 @@ GET_NEXT_SYMBOL (execvp); GET_NEXT_SYMBOL (fchown); GET_NEXT_SYMBOL (fopen); + GET_NEXT_SYMBOL (fopen64); GET_NEXT_SYMBOL (getgrnam); GET_NEXT_SYMBOL (getpwnam); GET_NEXT_SYMBOL (link); @@ -276,6 +278,25 @@ return (*libc_fopen) (pathname, mode); } +FILE *fopen64 (const char *pathname, const char *mode) +{ + int for_reading = + (strncmp (mode, "r", 1) == 0 && strncmp (mode, "r+", 2) != 0); + + if (for_reading && package_path && strcmp (pathname, package_path) == 0) { + int dup_fd = dup (package_fd); + lseek (dup_fd, 0, SEEK_SET); /* also changes offset of package_fd */ + return fdopen (dup_fd, mode); + } + + if (!for_reading) + clickpreload_assert_path_in_instdir ("write-fdopen", pathname); + + if (!libc_fopen64) + GET_NEXT_SYMBOL (fopen64); + return (*libc_fopen64) (pathname, mode); +} + int open (const char *pathname, int flags, ...) { int for_writing = ((flags & O_WRONLY) || (flags & O_RDWR));