mirror of
https://kernel.googlesource.com/pub/scm/network/tftp/tftp-hpa
synced 2025-04-26 01:49:52 +03:00

The source code was a mix of different styles; normalize on NASM style; basically K&R style with 4 space indentation.
23 lines
295 B
C
23 lines
295 B
C
/*
|
|
* dup2.c
|
|
*
|
|
* Ersatz dup2() for really ancient systems
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
int dup2(int oldfd, int newfd)
|
|
{
|
|
int rv, nfd;
|
|
|
|
close(newfd);
|
|
|
|
nfd = rv = dup(oldfd);
|
|
|
|
if (rv >= 0 && rv != newfd) {
|
|
rv = dup2(oldfd, newfd);
|
|
close(nfd);
|
|
}
|
|
|
|
return rv;
|
|
}
|