src/t_mtab: Add newlines to error messages
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Tue, 29 Aug 2017 13:37:13 +0000 (16:37 +0300)
committerEryu Guan <eguan@redhat.com>
Thu, 31 Aug 2017 04:25:23 +0000 (12:25 +0800)
I can't recall anymore what exactly I did to have tests using t_mtab
to fail, but nevertheless this commit adds the proper newlines.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
src/t_mtab.c

index 9bca954318f1a48d887ac44b89e47d8ffb03c19d..5e9d521675582646a2c1b458bfcebb9ab291ae49 100644 (file)
@@ -34,7 +34,7 @@ static int signals_have_been_setup = 0;
 /* Ensure that the lock is released if we are interrupted.  */
 static void
 handler (int sig) {
-    fprintf(stderr, "%s", sys_siglist[sig]);
+    fprintf(stderr, "%s\n", sys_siglist[sig]);
     exit(1);
 }
 
@@ -99,7 +99,7 @@ lock_mtab (void) {
                           Too many files open in the system?
                           Filesystem full? */
                        fprintf(stderr, "can't create lock file %s: %s "
-                            "(use -n flag to override)",
+                            "(use -n flag to override)\n",
                             linktargetfile, strerror (errsv));
                        exit(1);
                }
@@ -112,7 +112,7 @@ lock_mtab (void) {
 
                if (j < 0 && errsv != EEXIST) {
                        fprintf(stderr, "can't link lock file %s: %s "
-                            "(use -n flag to override)",
+                            "(use -n flag to override)\n",
                             mounted_lock, strerror (errsv));
                        exit(1);
                }
@@ -157,7 +157,7 @@ lock_mtab (void) {
                        if (fcntl (fd, F_SETLKW, &flock) == -1 &&
                            errno != EBUSY && errno != EAGAIN) {
                                int errsv = errno;
-                               fprintf(stderr, "can't lock lock file %s: %s",
+                               fprintf(stderr, "can't lock lock file %s: %s\n",
                                     mounted_lock, (errno == EINTR) ?
                                     _("timed out") : strerror (errsv));
                                exit(1);