Changeset 2648 for trunk/src/kash/jobs.c


Ignore:
Timestamp:
Sep 9, 2012, 5:22:30 AM (13 years ago)
Author:
bird
Message:

Made TRACE2 and TRACE2V safe. Fixed DEBUG bug where va_copy was missing. Introduced sh_strerror.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/jobs.c

    r2290 r2648  
    150150                if (sh_getpgid(psh, 0) != psh->rootpid && sh_setpgid(psh, 0, psh->rootpid) == -1)
    151151                        error(psh, "Cannot set process group (%s) at %d",
    152                             strerror(errno), __LINE__);
     152                            sh_strerror(psh, errno), __LINE__);
    153153                if (sh_tcsetpgrp(psh, psh->ttyfd, psh->rootpid) == -1)
    154154                        error(psh, "Cannot set tty process group (%s) at %d",
    155                             strerror(errno), __LINE__);
     155                            sh_strerror(psh, errno), __LINE__);
    156156        } else { /* turning job control off */
    157157                if (sh_getpgid(psh, 0) != psh->initialpgrp && sh_setpgid(psh, 0, psh->initialpgrp) == -1)
    158158                        error(psh, "Cannot set process group (%s) at %d",
    159                             strerror(errno), __LINE__);
     159                            sh_strerror(psh, errno), __LINE__);
    160160                if (sh_tcsetpgrp(psh, psh->ttyfd, psh->initialpgrp) == -1)
    161161                        error(psh, "Cannot set tty process group (%s) at %d",
    162                             strerror(errno), __LINE__);
     162                            sh_strerror(psh, errno), __LINE__);
    163163                shfile_close(&psh->fdtab, psh->ttyfd);
    164164                psh->ttyfd = -1;
     
    209209        if (i >= jp->nprocs) {
    210210                error(psh, "Cannot set tty process group (%s) at %d",
    211                     strerror(errno), __LINE__);
     211                    sh_strerror(psh, errno), __LINE__);
    212212        }
    213213        restartjob(psh, jp);
     
    301301                        break;
    302302        if (i >= jp->nprocs)
    303                 error(psh, "Cannot continue job (%s)", strerror(errno));
     303                error(psh, "Cannot continue job (%s)", sh_strerror(psh, errno));
    304304        for (ps = jp->ps, i = jp->nprocs ; --i >= 0 ; ps++) {
    305305                if (WIFSTOPPED(ps->status)) {
     
    485485                if (sh_tcsetpgrp(psh, psh->ttyfd, sh_getpid(psh)) == -1)
    486486                        error(psh, "Cannot set tty process group (%s) at %d",
    487                             strerror(errno), __LINE__);
     487                            sh_strerror(psh, errno), __LINE__);
    488488                TRACE((psh, "repaired tty process group\n"));
    489489                silent = 1;
     
    854854                        if (sh_tcsetpgrp(psh, psh->ttyfd, pgrp) == -1)
    855855                                error(psh, "Cannot set tty process group (%s) at %d",
    856                                     strerror(errno), __LINE__);
     856                                    sh_strerror(psh, errno), __LINE__);
    857857                }
    858858                setsignal(psh, SIGTSTP, vforked);
     
    927927                if (sh_tcsetpgrp(psh, psh->ttyfd, mypgrp) == -1)
    928928                        error(psh, "Cannot set tty process group (%s) at %d",
    929                             strerror(errno), __LINE__);
     929                            sh_strerror(psh, errno), __LINE__);
    930930        }
    931931        if (jp->state == JOBSTOPPED && psh->curjob != jp - psh->jobtab)
Note: See TracChangeset for help on using the changeset viewer.