ref: 096ac0cfd231fdd540bd35072592730634fab218
parent: 52a1caf80302fcaa86466785cd036bdfab2d2298
author: gkostka <kostka.grzegorz@gmail.com>
date: Sun Apr 6 12:49:08 EDT 2014
Remove warnings. Default port to 1234. Conditionally link winsock lib (only windows). Linux cachu bufer drop disabled.
--- a/blockdev/filedev/ext4_filedev.c
+++ b/blockdev/filedev/ext4_filedev.c
@@ -45,7 +45,7 @@
/**@brief Image file descriptor.*/
static FILE *dev_file;
-#define DROP_LINUXCACHE_BUFFERS 1
+#define DROP_LINUXCACHE_BUFFERS 0
/**********************BLOCKDEV INTERFACE**************************************/
--- a/fs_test/fs_test.cmake
+++ b/fs_test/fs_test.cmake
@@ -7,8 +7,11 @@
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
--- a/fs_test/lwext4_client.c
+++ b/fs_test/lwext4_client.c
@@ -27,7 +27,7 @@
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 @@
if(rc)
printf("\t%s\n",op_code);
- closesocket(sockfd);
return rc;
}
--- 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 @@
/**@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 @@
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 @@
close(connfd);
}
- closesocket(listenfd);
winsock_fini();
return 0;
}
@@ -786,7 +787,7 @@
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 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 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 @@
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 @@
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 @@
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 @@
{
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 @@
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;
}