fix action fetch in argv

pull/484/head
YuQing 2020-08-31 10:48:54 +08:00
parent fde110996b
commit 4aff731fd5
3 changed files with 6 additions and 8 deletions

View File

@ -794,22 +794,16 @@ int storage_do_upload_file1(ConnectionInfo *pTrackerServer, \
STORAGE_PROTO_CMD_UPLOAD_FILE and
STORAGE_PROTO_CMD_UPLOAD_APPENDER_FILE:
1 byte: store path index
8 bytes: meta data bytes
8 bytes: file size
FDFS_FILE_EXT_NAME_MAX_LEN bytes: file ext name
meta data bytes: each meta data seperated by \x01,
name and value seperated by \x02
file size bytes: file content
STORAGE_PROTO_CMD_UPLOAD_SLAVE_FILE:
8 bytes: master filename length
8 bytes: meta data bytes
8 bytes: file size
FDFS_FILE_PREFIX_MAX_LEN bytes : filename prefix
FDFS_FILE_EXT_NAME_MAX_LEN bytes: file ext name, do not include dot (.)
master filename bytes: master filename
meta data bytes: each meta data seperated by \x01,
name and value seperated by \x02
file size bytes: file content
**/
int storage_do_upload_file(ConnectionInfo *pTrackerServer, \

View File

@ -86,6 +86,7 @@ static void usage(const char *program)
int main(int argc, char *argv[])
{
char *conf_filename;
char *action;
int result;
int sock;
int wait_count;
@ -132,7 +133,8 @@ int main(int argc, char *argv[])
}
snprintf(pidFilename, sizeof(pidFilename),
"%s/data/fdfs_storaged.pid", g_fdfs_base_path);
if ((result=process_action(pidFilename, argv[2], &stop)) != 0)
action = argc >= 3 ? argv[2] : "start";
if ((result=process_action(pidFilename, action, &stop)) != 0)
{
if (result == EINVAL)
{

View File

@ -79,6 +79,7 @@ static void usage(const char *program)
int main(int argc, char *argv[])
{
char *conf_filename;
char *action;
int result;
int wait_count;
int sock;
@ -119,7 +120,8 @@ int main(int argc, char *argv[])
snprintf(pidFilename, sizeof(pidFilename),
"%s/data/fdfs_trackerd.pid", g_fdfs_base_path);
if ((result=process_action(pidFilename, argv[2], &stop)) != 0)
action = argc >= 3 ? argv[2] : "start";
if ((result=process_action(pidFilename, action, &stop)) != 0)
{
if (result == EINVAL)
{