See the accompanying LICENSE file for the full text of the license.
*/
-#if defined(__linux__)
-// Linux needs this to support file operation on files larger then 4+GB
-# ifndef __USE_FILE_OFFSET64
-# define __USE_FILE_OFFSET64
-# endif
-# ifndef __USE_LARGEFILE64
-# define __USE_LARGEFILE64
-# endif
-# ifndef _LARGEFILE64_SOURCE
-# define _LARGEFILE64_SOURCE
-# endif
-# ifndef _FILE_OFFSET_BIT
-# define _FILE_OFFSET_BIT 64
-# endif
-#endif
-
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
return NULL;
}
- if (CHDIR(directory)) // change to target directory
+ if (CHDIR(directory) != 0) // change to target directory
{
- debug_printf("Cannot change to directory '%s'!\n", directory);
+ debug_printf("Cannot change to directory '%s'!\n", directory);
- unzClose(uf);
+ unzClose(uf);
- return NULL;
+ return NULL;
}
int success = (miniunz_extract_all(uf, 0, 1, NULL) == UNZ_OK);
- CHDIR(last_directory); // change back to previous directory
+ if (CHDIR(last_directory) != 0) // change back to previous directory
+ {
+ debug_printf("Cannot change to directory '%s'!\n", last_directory);
+
+ unzClose(uf);
+
+ return NULL;
+ }
unzClose(uf);