Where <mtype> is the message type of the message received and
<len> is the length of the data that was written to the FIFO.
-
+
Date: 06 Oct 2019
Author: E. Scott Daniels
*/
not to discourage them from trying!).
*/
static int copy_unlink( char* old, char* new, int mode ) {
- char buf[8192]; // read buffer
- char* tfname; // temp file name while we have it open
- char* wbuf; // work buffer for disecting the new filename
- char* tok; // token pointer into a buffer
+ char buf[8192]; // read buffer
+ char* tfname = NULL; // temp file name while we have it open
+ char* wbuf; // work buffer for disecting the new filename
+ char* tok; // token pointer into a buffer
int len;
int rfd; // read/write file descriptors
int wfd;
if( (len = write( wfd, &buf[start], len )) != remain ) { // short write
if( errno != EINTR && errno != EAGAIN ) {
logit( LOG_ERR, "copy: write failed: %s", strerror( errno ) );
+ free( tfname );
close( wfd );
close( rfd );
return -1;
} else {
ctx->fdir = strdup( fdir );
}
-
+
}
if( suffix ) {