diff options
author | Scott Lobdell <slobdell@google.com> | 2021-04-10 00:27:34 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-04-10 00:27:34 +0000 |
commit | 01da99e3e562d93c902419316b2f6aa464777e16 (patch) | |
tree | 2fe6d242f8218ab669e2a98f757a85005ff88088 /cmds/incidentd/src/WorkDirectory.cpp | |
parent | 80bf29781b44a4c22692a3a1a1e60a371471c25a (diff) | |
parent | 6560a5b465795d6922ccd0c83693fa04be2910a6 (diff) |
Merge changes from topic "SP1A.210407.002" into s-keystone-qcom-dev
* changes:
Adapt to new ranking logic from upstream.
Revert "Initial data pipeline for Smartspace media recommendations data in media carousel."
Merge SP1A.210407.002
Diffstat (limited to 'cmds/incidentd/src/WorkDirectory.cpp')
-rw-r--r-- | cmds/incidentd/src/WorkDirectory.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmds/incidentd/src/WorkDirectory.cpp b/cmds/incidentd/src/WorkDirectory.cpp index 1944d6ecc720..23d80d7953b7 100644 --- a/cmds/incidentd/src/WorkDirectory.cpp +++ b/cmds/incidentd/src/WorkDirectory.cpp @@ -400,6 +400,7 @@ status_t ReportFile::startFilteringData(int writeFd, const IncidentReportArgs& a if (dataFd < 0) { ALOGW("Error opening incident report '%s' %s", getDataFileName().c_str(), strerror(-errno)); close(writeFd); + close(dataFd); return -errno; } @@ -409,6 +410,7 @@ status_t ReportFile::startFilteringData(int writeFd, const IncidentReportArgs& a ALOGW("Error running fstat incident report '%s' %s", getDataFileName().c_str(), strerror(-errno)); close(writeFd); + close(dataFd); return -errno; } if (st.st_size != mEnvelope.data_file_size()) { @@ -418,6 +420,7 @@ status_t ReportFile::startFilteringData(int writeFd, const IncidentReportArgs& a ALOGW("Removing incident report"); mWorkDirectory->remove(this); close(writeFd); + close(dataFd); return BAD_VALUE; } @@ -427,11 +430,13 @@ status_t ReportFile::startFilteringData(int writeFd, const IncidentReportArgs& a if (!zipPipe.init()) { ALOGE("[ReportFile] Failed to setup pipe for gzip"); close(writeFd); + close(dataFd); return -errno; } int status = 0; zipPid = fork_execute_cmd((char* const*)GZIP, zipPipe.readFd().release(), writeFd, &status); close(writeFd); + close(dataFd); if (zipPid < 0 || status != 0) { ALOGE("[ReportFile] Failed to fork and exec gzip"); return status; @@ -459,6 +464,7 @@ status_t ReportFile::startFilteringData(int writeFd, const IncidentReportArgs& a } close(writeFd); + close(dataFd); if (zipPid > 0) { status_t err = wait_child(zipPid, /* timeout_ms= */ 10 * 1000); if (err != 0) { |