diff options
author | endoffile78 <endoffile78@yahoo.com> | 2017-01-05 15:16:56 -0600 |
---|---|---|
committer | endoffile78 <endoffile78@yahoo.com> | 2017-01-05 15:16:56 -0600 |
commit | 59e2a844f04a8725e8079f854158aa86ef5988b2 (patch) | |
tree | 40130a9f28a5d08b6ff524156f5476b7359f75df /testing/tox_sync.c | |
parent | 0a61d1108547513211560e66809479cab5082ede (diff) |
Revert "Portability fixes"
This reverts commit f3469070fe899e8e4fd88665386a55bad9f77cd8.
Diffstat (limited to 'testing/tox_sync.c')
-rw-r--r-- | testing/tox_sync.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/testing/tox_sync.c b/testing/tox_sync.c index 6ac3dcf0..0c91abfd 100644 --- a/testing/tox_sync.c +++ b/testing/tox_sync.c | |||
@@ -28,8 +28,6 @@ | |||
28 | * | 28 | * |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #define _XOPEN_SOURCE 600 | ||
32 | |||
33 | #ifdef HAVE_CONFIG_H | 31 | #ifdef HAVE_CONFIG_H |
34 | #include "config.h" | 32 | #include "config.h" |
35 | #endif | 33 | #endif |
@@ -44,7 +42,6 @@ | |||
44 | #include <dirent.h> | 42 | #include <dirent.h> |
45 | #include <netinet/in.h> | 43 | #include <netinet/in.h> |
46 | #include <stdio.h> | 44 | #include <stdio.h> |
47 | #include <sys/stat.h> | ||
48 | 45 | ||
49 | #define NUM_FILE_SENDERS 256 | 46 | #define NUM_FILE_SENDERS 256 |
50 | typedef struct { | 47 | typedef struct { |
@@ -300,7 +297,6 @@ int main(int argc, char *argv[]) | |||
300 | memcpy(path, argv[argvoffset + 4], strlen(argv[argvoffset + 4])); | 297 | memcpy(path, argv[argvoffset + 4], strlen(argv[argvoffset + 4])); |
301 | DIR *d; | 298 | DIR *d; |
302 | struct dirent *dir; | 299 | struct dirent *dir; |
303 | struct stat statbuf; | ||
304 | uint8_t notconnected = 1; | 300 | uint8_t notconnected = 1; |
305 | 301 | ||
306 | while (1) { | 302 | while (1) { |
@@ -314,12 +310,7 @@ int main(int argc, char *argv[]) | |||
314 | 310 | ||
315 | if (d) { | 311 | if (d) { |
316 | while ((dir = readdir(d)) != NULL) { | 312 | while ((dir = readdir(d)) != NULL) { |
317 | char filepath[strlen(path) + strlen(dir->d_name) + 1]; | 313 | if (dir->d_type == DT_REG) { |
318 | memcpy(filepath, path, strlen(path)); | ||
319 | memcpy(filepath + strlen(path), dir->d_name, strlen(dir->d_name) + 1); | ||
320 | stat(filepath, &statbuf); | ||
321 | |||
322 | if (S_ISREG(statbuf.st_mode)) { | ||
323 | char fullpath[1024]; | 314 | char fullpath[1024]; |
324 | 315 | ||
325 | if (path[strlen(path) - 1] == '/') { | 316 | if (path[strlen(path) - 1] == '/') { |