diff options
| author | gkostka <kostka.grzegorz@gmail.com> | 2014-04-06 16:49:08 +0000 |
|---|---|---|
| committer | gkostka <kostka.grzegorz@gmail.com> | 2014-04-06 16:49:08 +0000 |
| commit | 096ac0cfd231fdd540bd35072592730634fab218 (patch) | |
| tree | 178019a6e6f619e2baad0205374a3cf206d1ef5d /fs_test | |
| parent | 52a1caf80302fcaa86466785cd036bdfab2d2298 (diff) | |
Remove warnings. Default port to 1234.
Conditionally link winsock lib (only windows).
Linux cachu bufer drop disabled.
Diffstat (limited to 'fs_test')
| -rw-r--r-- | fs_test/fs_test.cmake | 7 | ||||
| -rw-r--r-- | fs_test/lwext4_client.c | 3 | ||||
| -rw-r--r-- | fs_test/lwext4_server.c | 27 |
3 files changed, 20 insertions, 17 deletions
diff --git a/fs_test/fs_test.cmake b/fs_test/fs_test.cmake index affbe89..8bd946b 100644 --- a/fs_test/fs_test.cmake +++ b/fs_test/fs_test.cmake @@ -7,8 +7,11 @@ aux_source_directory(blockdev/filedev_win BLOCKDEV_SRC) add_executable(lwext4_server fs_test/lwext4_server.c ${BLOCKDEV_SRC})
target_link_libraries(lwext4_server lwext4)
+if(WIN32)
target_link_libraries(lwext4_server ws2_32)
-
+endif(WIN32)
add_executable(lwext4_client fs_test/lwext4_client.c ${BLOCKDEV_SRC})
target_link_libraries(lwext4_client lwext4)
-target_link_libraries(lwext4_client ws2_32)
\ No newline at end of file +if(WIN32)
+target_link_libraries(lwext4_client ws2_32)
+endif(WIN32)
\ No newline at end of file diff --git a/fs_test/lwext4_client.c b/fs_test/lwext4_client.c index ae77961..f1a6855 100644 --- a/fs_test/lwext4_client.c +++ b/fs_test/lwext4_client.c @@ -27,7 +27,7 @@ static void winsock_fini(void); static char *server_addr = "127.0.0.1";
/**@brief Default connection port.*/
-static int connection_port = 8888;
+static int connection_port = 1234;
/**@brief Call op*/
static char *op_code;
@@ -142,7 +142,6 @@ int main(int argc, char *argv[]) if(rc)
printf("\t%s\n",op_code);
- closesocket(sockfd);
return rc;
}
diff --git a/fs_test/lwext4_server.c b/fs_test/lwext4_server.c index deb9bd6..fefce29 100644 --- a/fs_test/lwext4_server.c +++ b/fs_test/lwext4_server.c @@ -1,8 +1,8 @@ +#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <errno.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
@@ -19,10 +19,12 @@ #include <sys/types.h>
#endif
-#include <ext4.h>
+
#include <ext4_filedev.h>
#include <io_raw.h>
+#include <ext4.h>
+
static int winsock_init(void);
static void winsock_fini(void);
static char* entry_to_str(uint8_t type);
@@ -35,7 +37,7 @@ static char* entry_to_str(uint8_t type); /**@brief Default connection port*/
-static int connection_port = 8888;
+static int connection_port = 1234;
/**@brief Default filesystem filename.*/
static char *ext4_fname = "ext2";
@@ -205,7 +207,7 @@ static int exec_op_code(char *opcode) clock_t t = get_ms();
r = op_call[i].lwext4_call(opcode);
- printf("rc: %d, time: %ums\n", r, get_ms() - t);
+ printf("rc: %d, time: %ums\n", r, (unsigned int)(get_ms() - t));
break;
}
@@ -322,7 +324,6 @@ int main(int argc, char *argv[]) close(connfd);
}
- closesocket(listenfd);
winsock_fini();
return 0;
}
@@ -786,7 +787,7 @@ int _multi_fcreate(char *p) int i;
ext4_file fd;
- if(sscanf(p, "%s %s %d", &path, prefix, &cnt) != 3){
+ if(sscanf(p, "%s %s %d", path, prefix, &cnt) != 3){
printf("Param list error\n");
return -1;
}
@@ -813,7 +814,7 @@ int _multi_fwrite(char *p) int i, d, wb;
ext4_file fd;
- if(sscanf(p, "%s %s %d %d", &path, prefix, &cnt, &ll) != 4){
+ if(sscanf(p, "%s %s %d %d", path, prefix, &cnt, &ll) != 4){
printf("Param list error\n");
return -1;
}
@@ -856,7 +857,7 @@ int _multi_fread(char *p) int i, d, rb;
ext4_file fd;
- if(sscanf(p, "%s %s %d %d", &path, prefix, &cnt, &ll) != 4){
+ if(sscanf(p, "%s %s %d %d", path, prefix, &cnt, &ll) != 4){
printf("Param list error\n");
return -1;
}
@@ -902,7 +903,7 @@ int _multi_fremove(char *p) char prefix[32];
int cnt, i, rc;
- if(sscanf(p, "%s %s %d", &path, prefix, &cnt) != 3){
+ if(sscanf(p, "%s %s %d", path, prefix, &cnt) != 3){
printf("Param list error\n");
return -1;
}
@@ -924,7 +925,7 @@ int _multi_dcreate(char *p) char prefix[32];
int cnt, i, rc;
- if(sscanf(p, "%s %s %d", &path, prefix, &cnt) != 3){
+ if(sscanf(p, "%s %s %d", path, prefix, &cnt) != 3){
printf("Param list error\n");
return -1;
}
@@ -946,7 +947,7 @@ int _multi_dremove(char *p) char prefix[32];
int cnt, i, rc;
- if(sscanf(p, "%s %s %d", &path, prefix, &cnt) != 3){
+ if(sscanf(p, "%s %s %d", path, prefix, &cnt) != 3){
printf("Param list error\n");
return -1;
}
@@ -967,7 +968,7 @@ int _stats_save(char *p) {
char path[256];
- if(sscanf(p, "%s", &path) != 1){
+ if(sscanf(p, "%s", path) != 1){
printf("Param list error\n");
return -1;
}
@@ -982,7 +983,7 @@ int _stats_check(char *p) struct ext4_mount_stats actual_stats;
- if(sscanf(p, "%s", &path) != 1){
+ if(sscanf(p, "%s", path) != 1){
printf("Param list error\n");
return -1;
}
|
