[Pvfs2-cvs] commit by slang in pvfs2/src/server: pvfs2-server.c

CVS commit program cvs at parl.clemson.edu
Fri Apr 4 11:21:55 EST 2008


Update of /projects/cvsroot/pvfs2/src/server
In directory parlweb1:/tmp/cvs-serv7558/src/server

Modified Files:
      Tag: pvfs-2-7-branch
	pvfs2-server.c 
Log Message:
fix for broken migrate collection admin tool since unified config file changes.  The migrate collection tool requires the alias to be passed when parsing the config file.


Index: pvfs2-server.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/pvfs2-server.c,v
diff -p -u -r1.246.2.2 -r1.246.2.3
--- pvfs2-server.c	29 Jan 2008 16:17:48 -0000	1.246.2.2
+++ pvfs2-server.c	4 Apr 2008 16:21:55 -0000	1.246.2.3
@@ -43,6 +43,7 @@
 #include "pint-cached-config.h"
 #include "pvfs2-internal.h"
 #include "src/server/request-scheduler/request-scheduler.h"
+#include "pint-util.h"
 
 #ifndef PVFS2_VERSION
 #define PVFS2_VERSION "Unknown"
@@ -156,7 +157,6 @@ static int create_pidfile(char *pidfile)
 static void write_pidfile(int fd);
 static void remove_pidfile(void);
 static int generate_shm_key_hint(void);
-static char *guess_alias(void);
 
 static TROVE_method_id trove_coll_to_method_callback(TROVE_coll_id);
 
@@ -1713,7 +1713,7 @@ static int server_parse_cmd_line_args(in
     if (s_server_options.server_alias == NULL)
     {
         /* Try to guess the alias from the hostname */
-        s_server_options.server_alias = guess_alias();
+        s_server_options.server_alias = PINT_util_guess_alias();
     }
     return 0;
 }
@@ -2103,34 +2103,6 @@ const char* PINT_map_server_op_to_string
     if (op >= 0 && op < PVFS_SERV_NUM_OPS)
         s = PINT_server_req_table[op].string_name;
     return s;
-}
-
-static char *guess_alias(void)
-{
-    char tmp_alias[1024];
-    char *tmpstr;
-    char *alias;
-    int ret;
-
-    /* hmm...failed to find alias as part of the server config filename,
-     * use the hostname to guess
-     */
-    ret = gethostname(tmp_alias, 1024);
-    if(ret != 0)
-    {
-        gossip_err("Failed to get hostname while attempting to guess "
-                   "alias.  Use -a to specify the alias for this server "
-                   "process directly\n");
-        return NULL;
-    }
-    alias = tmp_alias;
-
-    tmpstr = strstr(tmp_alias, ".");
-    if(tmpstr)
-    {
-        *tmpstr = 0;
-    }
-    return strdup(tmp_alias);
 }
 
 /* generate_shm_key_hint()



More information about the Pvfs2-cvs mailing list