- /* Set up file extension */
- strlcpy(filename, batch_prefix, sizeof(filename));
- strlcat(filename, rsync_argvs_file, sizeof(filename));
-
- /* Open batch argvs file for writing;
- * create it if it doesn't exist. */
- f = do_open(filename, O_WRONLY | O_CREAT | O_TRUNC,
- S_IREAD | S_IWRITE | S_IEXEC);
- if (f < 0) {
- rprintf(FERROR, "Batch file %s open error: %s\n",
- filename, strerror(errno));
+ stringjoin(filename, sizeof filename,
+ batch_prefix, rsync_argvs_file, NULL);
+ fd = do_open(filename, O_WRONLY | O_CREAT | O_TRUNC,
+ S_IRUSR | S_IWUSR | S_IEXEC);
+ if (fd < 0) {
+ rsyserr(FERROR, errno, "Batch file %s open error", filename);