Browse Source

Fixed compilation errors around off64_t

MissValeska 9 years ago
parent
commit
296e4e5519
2 changed files with 14 additions and 1 deletions
  1. 8
    1
      src/inet.c
  2. 6
    0
      src/inet.h

+ 8
- 1
src/inet.c View File

@@ -1060,7 +1060,7 @@ inet_send(int s, const void *msg, size_t len, int flags)
1060 1060
 			* it will just come back here to repeat the process as needed. */
1061 1061
 			case EMSGSIZE:
1062 1062
 				inet_send(s, msg, len/2, flags);
1063
-				err = inet_send(s, msg+(len/2), (len+1)/2);
1063
+				err = inet_send(s, msg+(len/2), (len+1)/2, flags);
1064 1064
                                 
1065 1065
                                 printf("%lu", err);
1066 1066
 				break;
@@ -1180,6 +1180,12 @@ inet_sendfile(int out_fd, int in_fd, off_t * offset, size_t count)
1180 1180
 	return err;
1181 1181
 }
1182 1182
 
1183
+/* For use in 32 bit systems requiring 64 bit operations */
1184
+
1185
+#if UINTPTR_MAX == 0xffffffff
1186
+#ifndef _LARGEFILE64_SOURCE
1187
+#define _LARGEFILE64_SOURCE
1188
+#endif
1183 1189
 ssize_t
1184 1190
 inet_sendfile64(int out_fd, int in_fd, off64_t * offset, size_t count)
1185 1191
 {
@@ -1193,3 +1199,4 @@ inet_sendfile64(int out_fd, int in_fd, off64_t * offset, size_t count)
1193 1199
         }
1194 1200
 	return err;
1195 1201
 }
1202
+#endif

+ 6
- 0
src/inet.h View File

@@ -209,6 +209,12 @@ ssize_t inet_sendto_timeout(int s, const void *msg, size_t len, int flags,
209 209
 							const struct sockaddr *to, socklen_t tolen,
210 210
 							u_int timeout);
211 211
 ssize_t inet_sendfile(int out_fd, int in_fd, off_t * offset, size_t count);
212
+#if UINTPTR_MAX == 0xffffffff
213
+#ifndef _LARGEFILE64_SOURCE
214
+#define _LARGEFILE64_SOURCE
215
+#endif
216
+ssize_t
212 217
 ssize_t inet_sendfile64(int out_fd, int in_fd, off64_t * offset, size_t count);
218
+#endif
213 219
 
214 220
 #endif							/*INET_H */

Loading…
Cancel
Save