Update of /cvsroot/freevo/freevo
In directory sc8-pr-cvs1:/tmp/cvs-serv32449
Modified Files:
runapp.c
Log Message:
Now only do the static check if we are trying to run an app from the runtime, where we
can load the
file with a relative path.
Index: runapp.c
===================================================================
RCS file: /cvsroot/freevo/freevo/runapp.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** runapp.c 10 Jun 2003 02:22:52 -0000 1.15
--- runapp.c 11 Jun 2003 03:44:18 -0000 1.16
***************
*** 117,144 ****
*/
- /* lets see is this app is staticly linked */
- /* this check is taken from lddlibc4.c of glibc-2.2.5 */
-
- /* First see whether this is really an a.out binary. */
- fp = fopen (av[1], "rb");
- if (fp == NULL) {
- LOG ("cannot open `%s'", av[1]);
- exit (1);
- }
-
- /* Read the program header. */
- if (fread (&exec, sizeof exec, 1, fp) < 1) {
- LOG ("cannot read header from `%s'", av[1]);
- }
- /* Test for the magic numbers. */
- else if (N_MAGIC (exec) != ZMAGIC && N_MAGIC (exec) != QMAGIC
- && N_MAGIC (exec) != OMAGIC) {
- LOG ("Looks like a staticly linked executable");
- static_linked = 1;
- }
-
- /* We don't need the file open anymore. */
- fclose (fp);
-
/* Make sure LD_PRELOAD is not set unless necessary */
--- 117,120 ----
***************
*** 175,186 ****
/* No, it is a regular app. Check if it is in the runtime */
! if (strstr (av[ac_idx], "runtime/apps/") != (char *) NULL &&
! !static_linked) {
! /* Yes, so the executable to start is the freevo_loader. */
! newav[newac++] = "./runtime/dll/freevo_loader";
! use_preloads = 1;
! LOG ("Runtime app, must use preloads");
} else {
/* Just a plain old app. It will be copied to newav[]�below */
--- 151,191 ----
/* No, it is a regular app. Check if it is in the runtime */
! if (strstr (av[ac_idx], "runtime/apps/") != (char *) NULL) {
! /* lets see is this app is staticly linked */
! /* this check is taken from lddlibc4.c of glibc-2.2.5 */
! /* First see whether this is really an a.out binary. */
! fp = fopen (av[ac_idx], "rb");
! if (fp == NULL) {
! LOG ("cannot open `%s'", av[1]);
! exit (1);
! }
!
! /* Read the program header. */
! if (fread (&exec, sizeof exec, 1, fp) < 1) {
! LOG ("cannot read header from `%s'", av[1]);
! }
! /* Test for the magic numbers. */
! else if (N_MAGIC (exec) != ZMAGIC && N_MAGIC (exec) != QMAGIC
! && N_MAGIC (exec) != OMAGIC) {
! LOG ("Looks like a staticly linked executable");
! static_linked = 1;
! }
!
! /* We don't need the file open anymore. */
! fclose (fp);
!
! if(!static_linked) {
! /* Yes, so the executable to start is the freevo_loader. */
! newav[newac++] = "./runtime/dll/freevo_loader";
! use_preloads = 1;
!
! LOG ("Runtime app, must use preloads");
! }
! else {
! /* Just a plain old app. It will be copied to newav[]�below */
! LOG ("Static app, no preloads");
! }
} else {
/* Just a plain old app. It will be copied to newav[]�below */
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog