From 5e8c3aab7acd24023d9f2569d9876e11e47e42b7 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 3 May 2017 22:50:54 +0200 Subject: remove unused hard link support Change-Id: I7f40598df74c8731b13c37b8adaa636086d204b4 --- onlineupdate/source/update/updater/updater.cxx | 34 -------------------------- 1 file changed, 34 deletions(-) diff --git a/onlineupdate/source/update/updater/updater.cxx b/onlineupdate/source/update/updater/updater.cxx index 3c5baca1e3ac..1e36b4d300f8 100644 --- a/onlineupdate/source/update/updater/updater.cxx +++ b/onlineupdate/source/update/updater/updater.cxx @@ -112,8 +112,6 @@ struct UpdateServerThreadArgs #define USE_EXECV #endif -# define MAYBE_USE_HARD_LINKS 0 - #if defined(VERIFY_MAR_SIGNATURE) && !defined(_WIN32) && !defined(MACOSX) #include #include @@ -639,26 +637,6 @@ static int ensure_copy_symlink(const NS_tchar *path, const NS_tchar *dest) } #endif -#if MAYBE_USE_HARD_LINKS -/* - * Creates a hardlink (destFilename) which points to the existing file - * (srcFilename). - * - * @return 0 if successful, an error otherwise - */ - -static int -create_hard_link(const NS_tchar *srcFilename, const NS_tchar *destFilename) -{ - if (link(srcFilename, destFilename) < 0) - { - LOG(("link(%s, %s) failed errno = %d", srcFilename, destFilename, errno)); - return WRITE_ERROR; - } - return OK; -} -#endif - // Copy the file named path onto a new file named dest. static int ensure_copy(const NS_tchar *path, const NS_tchar *dest) { @@ -689,18 +667,6 @@ static int ensure_copy(const NS_tchar *path, const NS_tchar *dest) } #endif -#if MAYBE_USE_HARD_LINKS - if (sUseHardLinks) - { - if (!create_hard_link(path, dest)) - { - return OK; - } - // Since we failed to create the hard link, fall through and copy the file. - sUseHardLinks = false; - } -#endif - AutoFile infile(ensure_open(path, NS_T("rb"), ss.st_mode)); if (!infile) { -- cgit