Lines 837-851
Link Here
|
837 |
{ |
837 |
{ |
838 |
if ((fd_lock = mkstemp(finish_last_countfile_lock)) == -1) |
838 |
if ((fd_lock = mkstemp(finish_last_countfile_lock)) == -1) |
839 |
{ |
839 |
{ |
840 |
delete g_interface; |
840 |
--nRetries; |
841 |
fprintf(stderr, i18n("Error: Cannot create lock for countfile")); |
841 |
sleep(2); |
842 |
return EXIT_FAILURE; |
842 |
continue; |
843 |
} |
843 |
} |
844 |
fLockFile = fdopen(fd_lock, "r"); |
844 |
fLockFile = fdopen(fd_lock, "r"); |
845 |
if (fLockFile == NULL) |
845 |
if (fLockFile == NULL) |
846 |
{ |
846 |
{ |
847 |
--nRetries; |
847 |
close(fd_lock); |
848 |
sleep(2); |
848 |
unlink(finish_last_countfile_lock); |
|
|
849 |
sleep(2); |
849 |
} |
850 |
} |
850 |
} while (fLockFile == NULL && nRetries); |
851 |
} while (fLockFile == NULL && nRetries); |
851 |
if (!nRetries) |
852 |
if (!nRetries) |
Lines 856-861
Link Here
|
856 |
} |
857 |
} |
857 |
if ((fd_countfile = mkstemp(finish_last_countfile)) == -1) |
858 |
if ((fd_countfile = mkstemp(finish_last_countfile)) == -1) |
858 |
{ |
859 |
{ |
|
|
860 |
fclose(fLockFile); |
861 |
close(fd_lock); |
862 |
unlink(finish_last_countfile_lock); |
863 |
|
859 |
delete g_interface; |
864 |
delete g_interface; |
860 |
fprintf(stderr, i18n("Error: Cannot create countfile")); |
865 |
fprintf(stderr, i18n("Error: Cannot create countfile")); |
861 |
return EXIT_FAILURE; |
866 |
return EXIT_FAILURE; |
Lines 863-868
Link Here
|
863 |
fCountFile = fdopen(fd_countfile, "r"); |
868 |
fCountFile = fdopen(fd_countfile, "r"); |
864 |
if (fCountFile == NULL) |
869 |
if (fCountFile == NULL) |
865 |
{ |
870 |
{ |
|
|
871 |
fclose(fLockFile); |
872 |
close(fd_lock); |
873 |
close(fd_countfile); |
874 |
unlink(finish_last_countfile_lock); |
875 |
unlink(finish_last_countfile); |
876 |
|
866 |
delete g_interface; |
877 |
delete g_interface; |
867 |
fprintf(stderr, i18n("Error: Cannot count remaining partimages")); |
878 |
fprintf(stderr, i18n("Error: Cannot count remaining partimages")); |
868 |
return EXIT_SUCCESS; |
879 |
return EXIT_SUCCESS; |