Fix for create toberep.data
This commit is contained in:
parent
0deb4ed4cb
commit
5734f08d5d
@ -44,7 +44,8 @@ v0.51.4 11-Apr-2004
|
|||||||
Added new experimental files database code which will only be
|
Added new experimental files database code which will only be
|
||||||
used if configured with --enable-experiment.
|
used if configured with --enable-experiment.
|
||||||
Another small change for double filename announces.
|
Another small change for double filename announces.
|
||||||
Change file open mode for double filename announces.
|
Changed file open mode for double filename announces.
|
||||||
|
Fixed create if toberep.data doesn't exist.
|
||||||
|
|
||||||
mbfile:
|
mbfile:
|
||||||
The toberep command now logs the toberep.data in the debug
|
The toberep command now logs the toberep.data in the debug
|
||||||
|
@ -49,9 +49,13 @@ int Add_ToBeRep(struct _filerecord report)
|
|||||||
fname = calloc(PATH_MAX, sizeof(char));
|
fname = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(fname, "%s/etc/toberep.data", getenv("MBSE_ROOT"));
|
sprintf(fname, "%s/etc/toberep.data", getenv("MBSE_ROOT"));
|
||||||
if ((tbr = fopen(fname, "r+")) == NULL) {
|
if ((tbr = fopen(fname, "r+")) == NULL) {
|
||||||
|
if ((tbr = fopen(fname, "a+")) == NULL) {
|
||||||
WriteError("$Can't create %s", fname);
|
WriteError("$Can't create %s", fname);
|
||||||
free(fname);
|
free(fname);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
} else {
|
||||||
|
Syslog('f', "Created new %s", fname);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
free(fname);
|
free(fname);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user