Update copyright notices in manual pages.
[febootstrap.git] / helper / init.c
index 514146f..34a8450 100644 (file)
 
 extern long init_module (void *, unsigned long, const char *);
 
+/* translation taken from module-init-tools/insmod.c  */
+static const char *moderror(int err)
+{
+  switch (err) {
+  case ENOEXEC:
+    return "Invalid module format";
+  case ENOENT:
+    return "Unknown symbol in module";
+  case ESRCH:
+    return "Module has wrong symbol version";
+  case EINVAL:
+    return "Invalid parameters";
+  default:
+    return strerror(err);
+  }
+}
+
 /* Leave this enabled for now.  When we get more confident in the boot
  * process we can turn this off or make it configurable.
  */
@@ -210,7 +227,7 @@ insmod (const char *filename)
   close (fd);
 
   if (init_module (buf, st.st_size, "") != 0) {
-    fprintf (stderr, "insmod: init_module: %s: %m\n", filename);
+    fprintf (stderr, "insmod: init_module: %s: %s\n", filename, moderror (errno));
     /* However ignore the error because this can just happen because
      * of a missing device.
      */
@@ -291,9 +308,9 @@ show_directory (const char *dirname)
   }
 
   while ((d = readdir (dir)) != NULL) {
-    fprintf (stderr, "%5d %c %-16s", d->d_ino, dirtype (d->d_type), d->d_name);
+    fprintf (stderr, "%5lu %c %-16s", d->d_ino, dirtype (d->d_type), d->d_name);
     if (lstat (d->d_name, &statbuf) >= 0) {
-      fprintf (stderr, " %06o %d %d:%d",
+      fprintf (stderr, " %06o %ld %d:%d",
                statbuf.st_mode, statbuf.st_size,
                statbuf.st_uid, statbuf.st_gid);
       if (S_ISLNK (statbuf.st_mode)) {