-/*
- * Convert from old format to new format
- * Convert from /etc/ddate to /etc/dumpdates format
- */
-o_nconvert()
-{
- FILE *oldfile;
- FILE *newfile;
- struct idates idate;
- struct idates idatecopy;
-
- if( (newfile = fopen(NINCREM, "w")) == NULL){
- msg("%s: Can not open %s to update.\n", processname, NINCREM);
- Exit(X_ABORT);
- }
- if ( (oldfile = fopen(OINCREM, "r")) != NULL){
- while(!feof(oldfile)){
- if (fread(&idate, sizeof(idate), 1, oldfile) != 1)
- break;
- /*
- * The old format ddate did not have
- * the full special path name on it;
- * we add the prefix /dev/ to the
- * special name, although this may not be
- * always the right thing to do.
- */
- idatecopy = idate;
- strcpy(idatecopy.id_name, "/dev/");
- strncat(idatecopy.id_name, idate.id_name,
- sizeof(idate.id_name) - sizeof ("/dev/"));
- recout(newfile, &idatecopy);
- }
- }
- fclose(oldfile);
- fclose(newfile);
-}
-