Skip to content

Commit 8c2495a

Browse files
committed
lkl/fs2tar: Fix compiler warnings
1 parent c7c2288 commit 8c2495a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tools/lkl/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ fs2tar: LDFLAGS += -larchive
6060
lklfuse: LDFLAGS += -lfuse
6161
ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64-freebsd))
6262
cptofs: LDFLAGS += -largp
63+
fs2tar: LDFLAGS += -largp
6364
endif
6465
cpfromfs: cptofs
6566
if ! [ -e $@ ]; then ln -s $< $@; fi

tools/lkl/fs2tar.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#ifdef __FreeBSD__
2+
#include <sys/param.h>
3+
#endif
4+
15
#include <stdio.h>
26
#include <time.h>
37
#include <argp.h>
@@ -351,11 +355,12 @@ int main(int argc, char **argv)
351355
goto out;
352356
}
353357

354-
disk_id = lkl_disk_add(bs);
355-
if (disk_id < 0) {
358+
ret = lkl_disk_add(bs);
359+
if (ret < 0) {
356360
fprintf(stderr, "can't add disk: %s\n", lkl_strerror(ret));
357361
goto out_close;
358362
}
363+
disk_id = ret;
359364

360365
lkl_start_kernel(&lkl_host_ops, 10 * 1024 * 1024, "");
361366

0 commit comments

Comments
 (0)