]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge commit 'fml/master'
authorAndre Noll <maan@systemlinux.org>
Fri, 28 Nov 2008 21:29:43 +0000 (22:29 +0100)
committerAndre Noll <maan@systemlinux.org>
Fri, 28 Nov 2008 21:29:43 +0000 (22:29 +0100)
alsa_write.c
fd.c
signal.c

index 0f0f1f7d152ef7d3d0b2086f64ffd4f45de2b283..cfae4fb9e20b322e36764d92806ba9f842ed1b0a 100644 (file)
@@ -133,7 +133,7 @@ static int alsa_open(struct writer_node *w)
                return -E_SW_PARAMS;
        pad->bytes_per_frame = snd_pcm_format_physical_width(FORMAT)
                * pad->channels / 8;
-       PARA_INFO_LOG("bytes per frame: %d\n", pad->bytes_per_frame);
+       PARA_INFO_LOG("bytes per frame: %zu\n", pad->bytes_per_frame);
        if (snd_pcm_nonblock(pad->handle, 1))
                PARA_ERROR_LOG("failed to set nonblock mode\n");
        return period_size * pad->bytes_per_frame;
diff --git a/fd.c b/fd.c
index 58851723978fb3c9856f87aa35d65a7141c162d7..d0b5c895a5f25d02b9f566fbe693a38898057203 100644 (file)
--- a/fd.c
+++ b/fd.c
@@ -285,9 +285,10 @@ int para_opendir(const char *dirname, DIR **dir, int *cwd)
        if (*dir)
                return 1;
        ret = -ERRNO_TO_PARA_ERROR(errno);
-/* Ignore return value of fchdir() and close(). We're busted anyway. */
-       if (cwd)
-               fchdir(*cwd);
+       /* Ignore return value of fchdir() and close(). We're busted anyway. */
+       if (cwd) {
+               int __a_unused ret2 = fchdir(*cwd); /* STFU, gcc */
+       }
 close_cwd:
        if (cwd)
                close(*cwd);
index f8be2f4612002214f669fa74ce92390866b0dc90..9168e918205a5f6733761db31ea7fc6573b2bbae 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -57,8 +57,15 @@ err_out:
  */
 static void generic_signal_handler(int s)
 {
-       write(signal_pipe[1], &s, sizeof(int));
-       //fprintf(stderr, "got sig %i, write returned %d\n", s, ret);
+       ssize_t ret = write(signal_pipe[1], &s, sizeof(int));
+
+       if (ret == sizeof(int))
+               return;
+       if (ret < 0)
+               PARA_EMERG_LOG("%s\n", strerror(errno));
+       else
+               PARA_EMERG_LOG("short write to signal pipe\n");
+       exit(EXIT_FAILURE);
 }
 
 /**