Changeset 14527
- Timestamp:
- May 9, 2015, 2:09:05 PM (6 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/file-posix.c
r14493 r14527 138 138 #ifdef HAVE_POSIX_FADVISE 139 139 140 posix_fadvise (handle, 0, 0, POSIX_FADV_SEQUENTIAL);140 (void) posix_fadvise (handle, 0, 0, POSIX_FADV_SEQUENTIAL); 141 141 142 142 #endif … … 144 144 #ifdef __APPLE__ 145 145 146 fcntl (handle, F_RDAHEAD, 1);147 fcntl (handle, F_NOCACHE, 1);146 (void) fcntl (handle, F_RDAHEAD, 1); 147 (void) fcntl (handle, F_NOCACHE, 1); 148 148 149 149 #endif -
trunk/libtransmission/net.c
r14482 r14527 145 145 **********************************************************************/ 146 146 147 int 147 void 148 148 tr_netSetTOS (tr_socket_t s, 149 149 int tos) 150 150 { 151 151 #ifdef IP_TOS 152 return setsockopt (s, IPPROTO_IP, IP_TOS, (const void *) &tos, sizeof (tos)); 152 if (setsockopt (s, IPPROTO_IP, IP_TOS, (const void *) &tos, sizeof (tos)) != -1) 153 return; 153 154 #else 154 return 0; 155 #endif 156 } 157 158 int 159 tr_netSetCongestionControl (tr_socket_t s UNUSED, 160 const char * algorithm UNUSED) 155 (void) s; 156 errno = ENOSYS; 157 #endif 158 159 tr_logAddNamedInfo ("Net", "Can't set TOS '%d': %s", tos, tr_strerror (errno)); 160 } 161 162 void 163 tr_netSetCongestionControl (tr_socket_t s, 164 const char * algorithm) 161 165 { 162 166 #ifdef TCP_CONGESTION 163 return setsockopt (s, IPPROTO_TCP, TCP_CONGESTION, 164 (const void *) algorithm, strlen (algorithm) + 1); 167 if (setsockopt (s, IPPROTO_TCP, TCP_CONGESTION, 168 (const void *) algorithm, strlen (algorithm) + 1) != -1) 169 return; 170 165 171 #else 172 (void) s; 166 173 errno = ENOSYS; 167 return -1; 168 #endif 174 #endif 175 176 tr_logAddNamedInfo ("Net", "Can't set congestion control algorithm '%s': %s", 177 algorithm, tr_strerror (errno)); 169 178 } 170 179
Note: See TracChangeset
for help on using the changeset viewer.