Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 394369 - sys-apps/openrc-9999 commit 5e01051c runscript.c:1139:5: error: 'file' undeclared
Summary: sys-apps/openrc-9999 commit 5e01051c runscript.c:1139:5: error: 'file' undecl...
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-11 20:25 UTC by Duncan
Modified: 2011-12-11 22:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan 2011-12-11 20:25:20 UTC
Commit 5e01051c says it was a revert.  But it missed something, as "file" is now undeclared on line 1139:

make[2]: Entering directory `/tmp/portage/sys-apps/openrc-9999/work/openrc-9999/src/rc'
echo "#define VERSION \"0.9.7git-5e0105\"" >version.h.tmp
if test -n "Gentoo Linux"; then \
        echo "#define BRANDING \"Gentoo Linux\"" >> version.h.tmp; \
fi

[snip]

x86_64-pc-linux-gnu-gcc -march=opteron-sse3 -pipe -O2 -frename-registers -fweb -fmerge-all-constants -fgcse-sm -fgcse-las -fgcse-after-reload -ftree-vectorize -freorder-blocks-and-partition -combine -std=c99 -Wall -Wextra -Wimplicit -Wshadow -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wnested-externs -Winline -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith -Wdeclaration-after-statement -Wsequence-point   -I../includes -I../librc -I../libeinfo -D_BSD_SOURCE -D_XOPEN_SOURCE=600  -DHAVE_TERMCAP -DHAVE_PAM -c runscript.c -o runscript.o

[snip]

runscript.c: In function 'runscript':
runscript.c:1139:5: error: 'file' undeclared (first use in this function)
runscript.c:1139:5: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [runscript.o] Error 1


From that commit (see those three "file" assignments):

+               if (strchr(lnk, '/')) {
+                       save = xstrdup(dir);
+                       saveLnk = xstrdup(lnk);
+                       dir = dirname(saveLnk);
+                       if (strcmp(dir, save) == 0)
+                               file = basename_c(argv[1]);
+                       else
+                               file = basename_c(lnk);
+                       dir = save;
+               } else
+                       file = basename_c(argv[1]);


(This one appears pretty straightforward so emerge --info openrc, etc, shouldn't be needed.  Let me know if you think otherwise.)

Duncan
Comment 1 William Hubbs gentoo-dev 2011-12-11 20:44:38 UTC
This is fixed in e574b5d.
Thanks for the report.
Comment 2 Duncan 2011-12-11 22:21:35 UTC
Verified/fixed.  Built and rebooted on:

$ rc --version
rc (OpenRC) 0.9.7git-e574b5 (Gentoo Linux)

Thanks. =:^)