Lines Matching refs:fn
705 static void DeleteFile(const std::string& fn) { in DeleteFile() argument
706 if (fn.empty()) return; in DeleteFile()
708 LOG(INFO) << "deleting " << fn; in DeleteFile()
710 if (unlink(fn.c_str()) == -1 && errno != ENOENT) { in DeleteFile()
711 PLOG(ERROR) << "unlink \"" << fn << "\" failed"; in DeleteFile()
754 std::string fn = GetStashFileName(params.stashbase, id, ""); in LoadStash() local
757 if (stat(fn.c_str(), &sb) == -1) { in LoadStash()
759 PLOG(ERROR) << "stat \"" << fn << "\" failed"; in LoadStash()
765 LOG(INFO) << " loading " << fn; in LoadStash()
768 LOG(ERROR) << fn << " size " << sb.st_size << " not multiple of block size " << BLOCKSIZE; in LoadStash()
772 android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(fn.c_str(), O_RDONLY))); in LoadStash()
775 PLOG(ERROR) << "open \"" << fn << "\" failed"; in LoadStash()
789 LOG(ERROR) << "unexpected contents in " << fn; in LoadStash()
797 DeleteFile(fn); in LoadStash()
815 std::string fn = GetStashFileName(base, id, ".partial"); in WriteStash() local
837 TEMP_FAILURE_RETRY(open(fn.c_str(), O_WRONLY | O_CREAT | O_TRUNC, STASH_FILE_MODE))); in WriteStash()
840 PLOG(ERROR) << "failed to create \"" << fn << "\""; in WriteStash()
845 PLOG(ERROR) << "failed to chown \"" << fn << "\""; in WriteStash()
857 PLOG(ERROR) << "fsync \"" << fn << "\" failed"; in WriteStash()
861 if (rename(fn.c_str(), cn.c_str()) == -1) { in WriteStash()
862 PLOG(ERROR) << "rename(\"" << fn << "\", \"" << cn << "\") failed"; in WriteStash()
917 EnumerateStash(dirname, [](const std::string& fn) { in CreateStash() argument
918 if (android::base::EndsWith(fn, ".partial")) { in CreateStash()
919 DeleteFile(fn); in CreateStash()
924 EnumerateStash(dirname, [&existing](const std::string& fn) { in CreateStash() argument
925 if (fn.empty()) return; in CreateStash()
927 if (stat(fn.c_str(), &sb) == -1) { in CreateStash()
928 PLOG(ERROR) << "stat \"" << fn << "\" failed"; in CreateStash()