Changeset 5fb43ca for BOOK/final-system/multilib
- Timestamp:
- Sep 30, 2006, 7:04:47 PM (18 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- c19067a
- Parents:
- bd2e5bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/final-system/multilib/multiarch_wrapper.xml
rbd2e5bb r5fb43ca 29 29 30 30 <screen os="b"><userinput>cat > multiarch_wrapper.c << "EOF" 31 #include < stdio.h>31 #include <unistd.h> 32 32 #include <stdlib.h> 33 #include <errno.h> 33 34 #include <string.h> 34 #include <errno.h>35 35 36 #ifndef DEFAULT _ARCH37 # define DEFAULT_ARCH"64"36 #ifndef DEFAULTENV 37 #define DEFAULTENV "64" 38 38 #endif 39 39 40 int main (int argc, char *argv[])40 int main(int argc, char **argv) 41 41 { 42 char *filename; 42 43 char *use_arch; 43 if ((use_arch = getenv("USE_ARCH")) == NULL)44 use_arch = DEFAULT_ARCH;45 44 46 char *filename = malloc(strlen(argv[0]) + strlen(use_arch) + 2); 45 if(!(use_arch = getenv("USE_ARCH"))) 46 use_arch = DEFAULTENV; 47 48 filename = (char *) malloc(strlen(argv[0]) + strlen(use_arch) + 2); 47 49 strcpy(filename, argv[0]); 48 50 strcat(filename, "-"); 49 51 strcat(filename, use_arch); 50 52 51 int ret = execvp(filename, argv); 52 if ((ret != 0)&&(errno != 0)) 53 { 54 char *errmsg = malloc(strlen(filename) + 19); 55 strcpy(errmsg, "Unable to execute "); 56 strcat(errmsg, filename); 57 perror(errmsg); 58 free(errmsg); 59 } 60 53 execvp(filename, argv); 54 perror(argv[0]); 61 55 free(filename); 62 63 return ret;64 56 } 65 57 EOF</userinput></screen>
Note:
See TracChangeset
for help on using the changeset viewer.