summaryrefslogtreecommitdiffstats
path: root/helper/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'helper/kernel.c')
-rw-r--r--helper/kernel.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/helper/kernel.c b/helper/kernel.c
index 3301826..0903805 100644
--- a/helper/kernel.c
+++ b/helper/kernel.c
@@ -122,16 +122,18 @@ create_kernel (const char *hostcpu, const char *kernel)
sort (candidates, reverse_filevercmp);
- /* Choose the first candidate. */
- char *tmp = xasprintf (KERNELDIR "/%s", candidates[0]);
+ if (kernel) {
+ /* Choose the first candidate. */
+ char *tmp = xasprintf (KERNELDIR "/%s", candidates[0]);
- if (verbose)
- fprintf (stderr, "creating symlink %s -> %s\n", kernel, tmp);
+ if (verbose >= 2)
+ fprintf (stderr, "creating symlink %s -> %s\n", kernel, tmp);
- if (symlink (tmp, kernel) == -1)
- error (EXIT_FAILURE, errno, "symlink kernel");
+ if (symlink (tmp, kernel) == -1)
+ error (EXIT_FAILURE, errno, "symlink kernel");
- free (tmp);
+ free (tmp);
+ }
return get_modpath (candidates[0]);