Print this page
11238 librtld_db demos should work with gcc 7

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/librtld_db/demo/common/main.c
          +++ new/usr/src/cmd/sgs/librtld_db/demo/common/main.c
↓ open down ↓ 161 lines elided ↑ open up ↑
 162  162          /*
 163  163           * set up for tracing the child.
 164  164           */
 165  165          init_proc();
 166  166  
 167  167          /*
 168  168           * create a child to fork and exec from.
 169  169           */
 170  170          if ((cpid = fork()) == 0) {
 171  171                  (void) execv(argv[optind], &argv[optind]);
 172      -                perr(argv[1]);
      172 +                perr(argv[optind]);
 173  173          }
 174  174  
 175  175          if (cpid == -1) /* fork() failure */
 176  176                  perr(command);
 177  177  
 178  178          /*
 179  179           * initialize libelf
 180  180           */
 181  181          if (elf_version(EV_CURRENT) == EV_NONE) {
 182  182                  (void) fprintf(stderr, "elf_version() failed: %s\n",
↓ open down ↓ 131 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX