/*
SSSD
Backup files
Copyright (C) Simo Sorce 2009
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <fcntl.h>
#include <stddef.h>
#include <stdlib.h>
{
char *dst_file;
int ret, i;
if (src_fd < 0) {
goto done;
}
if (!tmp_ctx) {
goto done;
}
/* try a few times to come up with a new backup file, then give up */
for (i = 0; i < 10; i++) {
if (i == 0) {
} else {
}
if (!dst_file) {
goto done;
}
errno = 0;
if (dst_fd >= 0) break;
goto done;
}
}
if (ret != 0) {
goto done;
}
/* copy file contents */
while (1) {
errno = 0;
if (numread < 0) {
goto done;
}
if (numread == 0) break;
errno = 0;
if (written == -1) {
goto done;
}
goto done;
}
}
done:
return ret;
}