Commit a586cc23 authored by 's avatar
Browse files

Undo automatic rename when overwritting files in local MAPI


git-svn-id: file:///home/svn/mapi/trunk@814 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 65536ada
......@@ -1542,13 +1542,12 @@ int mapi_apply_function(int fd, const char* funct, ...)
*/
case 'w':
//Open file for writing
// printf("--------------agent = %d\n", agent);
if (agent==0) filename=va_arg(vl, char*);
else {
filename=(char*)args;
args+=strlen(filename)+1;
}
//if (agent == 1) {
if (agent == 1) {
//filename = (tmp_fname=strrchr(filename, '/'))?(tmp_fname+1):filename;
tmp=open(filename, O_WRONLY|O_TRUNC|O_CREAT|O_EXCL|O_LARGEFILE,S_IRUSR|S_IWUSR);
while(tmp==-1 && errno==EEXIST) {
......@@ -1556,10 +1555,10 @@ int mapi_apply_function(int fd, const char* funct, ...)
tmp=open(tmp_fname, O_WRONLY|O_TRUNC|O_CREAT|O_EXCL|O_LARGEFILE,S_IRUSR|S_IWUSR);
free(tmp_fname);
}
//}
//else {
// tmp=open(filename,O_WRONLY|O_TRUNC|O_CREAT|O_LARGEFILE,S_IRUSR|S_IWUSR);
//}
}
else {
tmp=open(filename,O_WRONLY|O_TRUNC|O_CREAT|O_LARGEFILE,S_IRUSR|S_IWUSR);
}
if(tmp==-1) { //|| numfd==256)
DEBUG_CMD(printf("Error creating file: %s [%s:%d]\n",filename,__FILE__,__LINE__));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment