~ubuntu-branches/ubuntu/trusty/sudo/trusty-proposed

« back to all changes in this revision

Viewing changes to common/sudo_debug.c

  • Committer: Package Import Robot
  • Author(s): Bdale Garbee
  • Date: 2014-01-15 14:55:25 UTC
  • mfrom: (1.7.3)
  • mto: This revision was merged to the branch mainline in revision 65.
  • Revision ID: package-import@ubuntu.com-20140115145525-f9ixkvriuylbuhkj
Tags: 1.8.9p4-1
new upstream release, closes: #732008

Show diffs side-by-side

added added

removed removed

Lines of Context:
570
570
{
571
571
    return sudo_debug_fd;
572
572
}
 
573
 
 
574
/*
 
575
 * Setter for the debug descriptor.
 
576
 */
 
577
int
 
578
sudo_debug_fd_set(int fd)
 
579
{
 
580
    if (sudo_debug_fd != -1 && fd != sudo_debug_fd) {
 
581
        if (dup2(sudo_debug_fd, fd) == -1)
 
582
            return -1;
 
583
        (void)fcntl(fd, F_SETFD, FD_CLOEXEC);
 
584
        close(sudo_debug_fd);
 
585
        sudo_debug_fd = fd;
 
586
    }
 
587
    return sudo_debug_fd;
 
588
}