]> granicus.if.org Git - transmission/commitdiff
silence a small handful of minor gcc compiler warnings in libtransmission
authorJordan Lee <jordan@transmissionbt.com>
Sat, 17 Aug 2013 17:03:15 +0000 (17:03 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sat, 17 Aug 2013 17:03:15 +0000 (17:03 +0000)
libtransmission/libtransmission-test.c
libtransmission/rename-test.c
libtransmission/trevent.c

index a0cf1f52921c51352271b0ac2bb1620e37c16b27..d2d6679fe9991c2f640c13c60fd702c325eea1be 100644 (file)
@@ -343,7 +343,7 @@ libttest_zero_torrent_populate (tr_torrent * tor, bool complete)
 
   for (i=0; i<tor->info.fileCount; ++i)
     {
-      int rv;
+      int err;
       uint64_t j;
       FILE * fp;
       char * path;
@@ -367,8 +367,11 @@ libttest_zero_torrent_populate (tr_torrent * tor, bool complete)
 
       path = tr_torrentFindFile (tor, i);
       assert (path != NULL);
-      rv = stat (path, &sb);
-      assert (rv == 0);
+      err = errno;
+      errno = 0;
+      stat (path, &sb);
+      assert (errno == 0);
+      errno = err; 
       tr_free (path);
     }
 
index 7860321bfa201433cc91cda0446f47e14574ff4b..71368562da579542635080326553b368eb4bdaf3 100644 (file)
@@ -86,7 +86,6 @@ torrentRenameAndWait (tr_torrent * tor,
 static void
 create_file_with_contents (const char * path, const char * str)
 {
-  int rv;
   FILE * fp;
   char * dir;
   const int tmperr = errno;
index b5ba203ed79b5709e7858495c5d7301c9298f635..d99a82bc4801797c0dd115ba45958622d1b9b193 100644 (file)
@@ -265,7 +265,8 @@ tr_eventInit (tr_session * session)
 
     eh = tr_new0 (tr_event_handle, 1);
     eh->lock = tr_lockNew ();
-    pipe (eh->fds);
+    if (pipe (eh->fds) == -1)
+      tr_logAddError ("Unable to write to pipe() in libtransmission: %s", tr_strerror(errno));
     eh->session = session;
     eh->thread = tr_threadNew (libeventThreadFunc, eh);