projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Update where we do full build
[awesomized/libmemcached]
/
clients
/
memslap.cc
diff --git
a/clients/memslap.cc
b/clients/memslap.cc
index d32b1c040e79b6e686506dd3d06f011ae8b11c20..e66ab0fd584dbba094d675e55ef127b5083680e3 100644
(file)
--- a/
clients/memslap.cc
+++ b/
clients/memslap.cc
@@
-39,6
+39,7
@@
#include <mem_config.h>
#include <cassert>
#include <mem_config.h>
#include <cassert>
+#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cstring>
@@
-50,7
+51,6
@@
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <sys/types.h>
#include <unistd.h>
#include <iostream>
#include <unistd.h>
#include <iostream>
@@
-468,15
+468,33
@@
void options_parse(int argc, char *argv[])
break;
case OPT_SLAP_CONCURRENCY:
break;
case OPT_SLAP_CONCURRENCY:
+ errno= 0;
opt_concurrency= (unsigned int)strtoul(optarg, (char **)NULL, 10);
opt_concurrency= (unsigned int)strtoul(optarg, (char **)NULL, 10);
+ if (errno != 0)
+ {
+ fprintf(stderr, "Invalid value for concurrency: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
break;
case OPT_SLAP_EXECUTE_NUMBER:
break;
case OPT_SLAP_EXECUTE_NUMBER:
+ errno= 0;
opt_execute_number= (unsigned int)strtoul(optarg, (char **)NULL, 10);
opt_execute_number= (unsigned int)strtoul(optarg, (char **)NULL, 10);
+ if (errno != 0)
+ {
+ fprintf(stderr, "Invalid value for execute: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
break;
case OPT_SLAP_INITIAL_LOAD:
break;
case OPT_SLAP_INITIAL_LOAD:
+ errno= 0;
opt_createial_load= (unsigned int)strtoul(optarg, (char **)NULL, 10);
opt_createial_load= (unsigned int)strtoul(optarg, (char **)NULL, 10);
+ if (errno != 0)
+ {
+ fprintf(stderr, "Invalid value for initial load: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
break;
case OPT_QUIET:
break;
case OPT_QUIET: