[PC-BSD Commits] r1220 - pcbsd/trunk/PBCsource
svn at pcbsd.org
svn at pcbsd.org
Fri Jan 18 05:29:55 PST 2008
Author: kris
Date: 2008-01-18 05:29:55 -0800 (Fri, 18 Jan 2008)
New Revision: 1220
Modified:
pcbsd/trunk/PBCsource/pbistart.c
Log:
Fixed up some more bugs reading in all the PBI installer tarball initially.
and speed up the kdesu dialog a bit more.
Modified: pcbsd/trunk/PBCsource/pbistart.c
===================================================================
--- pcbsd/trunk/PBCsource/pbistart.c 2008-01-18 00:49:57 UTC (rev 1219)
+++ pcbsd/trunk/PBCsource/pbistart.c 2008-01-18 13:29:55 UTC (rev 1220)
@@ -114,22 +114,17 @@
system(awkcmd);
-if ((file = open(tmpfile, 0x0)) < 0 ) {
- exit(2);
-}
+FILE *linefile = fopen(tmpfile, "r");
-charread = read(file, lineskip, 2);
-lineskip[charread]='\0';
+fscanf(linefile, "%s", lineskip);
+
+fclose(linefile);
unlink(tmpfile);
-//printf("Lineskip=%s\n", lineskip);
+//printf("Lineskip=%sdone\n", lineskip);
-close(file);
-
-
-
/* Get the current directory */
strcpy(tmpfile, tmpdir);
strcat(tmpfile, ".tmppbipwd");
@@ -221,16 +216,12 @@
strcat(awkcmd, tmpfile);
system(awkcmd);
-// Get the pbi skip location so we know where to stop reading
-if ((file = open(tmpfile, 0x0)) < 0 ) {
- exit(2);
-}
+FILE *pbiskipfile = fopen(tmpfile, "r");
-charread = read(file, pbiskip, 4);
-pbiskip[charread]='\0';
+fscanf(pbiskipfile, "%s", pbiskip);
+fclose(pbiskipfile);
-//printf("PBIskip=%s\n", pbiskip);
-close(file);
+//printf("PBIskip=%sdone\n", pbiskip);
// Get how many lines we want to read now
strcpy(whoamicmd, "expr ");
@@ -246,16 +237,13 @@
strcat(tmpfile, "/tarreadlines");
-// Get the pbi skip location so we know where to stop reading
-if ((file = open(tmpfile, 0x0)) < 0 ) {
- exit(2);
-}
+FILE *pbiskipfile2 = fopen(tmpfile, "r");
-charread = read(file, tardatalines, 4);
-tardatalines[charread]='\0';
+fscanf(pbiskipfile2, "%s", tardatalines);
+fclose(pbiskipfile2);
-//printf("tardatalines=%s\n", tardatalines);
-close(file);
+//printf("tardatalines=%sdone\n", tardatalines);
+//system("sleep 10");
More information about the Commits
mailing list