+#define _GNU_SOURCE
+
#include <stdio.h>
#include <getopt.h>
#include <string.h>
char cwd[PATH_MAX];
if (file[0] != '/') {
- getcwd(cwd, PATH_MAX);
+ if (getcwd(cwd, PATH_MAX) == NULL) {
+ fprintf(stderr, "Failed to getcwd\n");
+ exit(EXIT_FAILURE);
+ }
ret = malloc(strlen(cwd) + 1 + strlen(file) + 1);
if (ret)
sprintf(ret, "%s/%s", cwd, file);
{
int opt;
int out_fd;
- errcode_t retval;
struct sparse_file *s;
while ((opt = getopt(argc, argv, "czS")) != -1) {
errcode_t android_configure_fs(ext2_filsys fs, char *src_dir, char *target_out,
char *mountpoint,
- struct selinux_opt *seopts,
- unsigned int nopt,
+ struct selinux_opt *seopts EXT2FS_ATTR((unused)),
+ unsigned int nopt EXT2FS_ATTR((unused)),
char *fs_config_file, time_t fixed_time)
{
errcode_t retval;
buf = calloc(num, block_size);
if (!buf) {
- fprintf(stderr, "failed to alloc %lu\n", num * block_size);
+ fprintf(stderr, "failed to alloc %llu\n",
+ (unsigned long long)num * block_size);
return EXT2_ET_NO_MEMORY;
}