Get rid of some more warnings

This commit is contained in:
Mike Gelfand 2015-12-29 00:42:40 +00:00
parent 15c9e5c126
commit a6d4bd35fc
5 changed files with 10 additions and 7 deletions

View File

@ -11,7 +11,7 @@
#include <errno.h>
#include <pthread.h>
#include <signal.h>
#include <stdlib.h> /* daemon (), exit () */
#include <stdlib.h> /* abort (), daemon (), exit () */
#include <fcntl.h> /* open () */
#include <unistd.h> /* fork (), setsid (), chdir (), dup2 (), close (), pipe () */
@ -70,7 +70,8 @@ send_signal_to_pipe (int sig)
{
const int old_errno = errno;
write (signal_pipe[1], &sig, sizeof (sig));
if (write (signal_pipe[1], &sig, sizeof (sig)) == -1)
abort ();
errno = old_errno;
}

View File

@ -2178,7 +2178,8 @@ torrentCallScript (const tr_torrent * tor, const char * script)
for (i = 0; env[i] != NULL; ++i)
putenv (env[i]);
(void) chdir ("/");
if (chdir ("/") == -1)
/* ignore (nice to have but not that critical) */;
if (execvp (script, cmd) == -1)
tr_logAddTorErr (tor, "error executing script \"%s\": %s", script, tr_strerror (errno));

View File

@ -404,7 +404,8 @@ tr_lpdEnabled (const tr_session* ss)
* @remark Declared inline for the compiler not to allege us of feeding unused
* functions. In any other respect, lpd_consistencyCheck is an orphaned function.
*/
static inline void lpd_consistencyCheck (void)
UNUSED static inline void
lpd_consistencyCheck (void)
{
/* if the following check fails, the definition of a hash string has changed
* without our knowledge; revise string handling in functions tr_lpdSendAnnounce

View File

@ -812,7 +812,7 @@ tr_urlParse (const char * url,
const char * host_end = memchr (authority, ':', authority_len);
const size_t host_len = host_end != NULL ? host_end - authority : authority_len;
const size_t host_len = host_end != NULL ? (size_t) (host_end - authority) : authority_len;
if (host_len == 0)
return false;

View File

@ -360,10 +360,10 @@ void tr_hex_to_binary (const char * input, void * output, size_t byte_length) TR
bool tr_addressIsIP (const char * address);
/** @brief return true if the url is a http or https or UDP url that Transmission understands */
bool tr_urlIsValidTracker (const char * url) TR_GNUC_NONNULL (1);
bool tr_urlIsValidTracker (const char * url);
/** @brief return true if the url is a [ http, https, ftp, sftp ] url that Transmission understands */
bool tr_urlIsValid (const char * url, size_t url_len) TR_GNUC_NONNULL (1);
bool tr_urlIsValid (const char * url, size_t url_len);
/** @brief parse a URL into its component parts
@return True on success or false if an error occurred */