ソースを参照

Properly process the ld.so.conf file if it has includes.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1044 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 20 年 前
コミット
72d0145e03
1 ファイル変更6 行追加2 行削除
  1. 6 2
      lcr/lcr_ifact.c

+ 6 - 2
lcr/lcr_ifact.c

@@ -209,7 +209,8 @@ static int ldso_path_build (char *path, char *filename)
 	FILE *fp;
 	char string[1024];
 	char filename_cat[1024];
-	char *newpath;
+	char newpath[1024];
+	char *newpath_tmp;
 	char *new_filename;
 	int j;
 	struct dirent **scandir_list;
@@ -240,7 +241,7 @@ static int ldso_path_build (char *path, char *filename)
 	while (fgets (string, sizeof (string), fp)) {
 		string[strlen(string) - 1] = '\0';
 		if (strncmp (string, "include", strlen ("include")) == 0) {
-			newpath = string + strlen ("include") + 1;
+			newpath_tmp = string + strlen ("include") + 1;
 			for (j = strlen (string);
 				string[j] != ' ' &&
 					string[j] != '/' &&
@@ -249,6 +250,9 @@ static int ldso_path_build (char *path, char *filename)
 			}
 			string[j] = '\0';
 			new_filename = &string[j] + 1;
+			strcpy (newpath, path);
+			strcat (newpath, "/");
+			strcat (newpath, newpath_tmp);
 			ldso_path_build (newpath, new_filename);
 			continue;
 		}