- {
- if ((srcfd = openat(sdfd, CCS filename, O_RDONLY)) < 0)
- {
- addr->transport_return = DEFER;
- addr->basic_errno = errno;
- addr->message = string_sprintf("%s transport opening file: %s "
- "failed with error: %s", tname, srcpath, strerror(errno));
- return FALSE;
- }
- }
-
- if ((src_file = fdopen(srcfd, "rb")) < 0)
- {
- addr->transport_return = DEFER;
- addr->basic_errno = errno;
- addr->message = string_sprintf("%s transport opening file fd: "
- "%s failed with error: %s", tname, srcpath, strerror(errno));
- if (!is_data_file) (void)close(srcfd);
- return FALSE;
- }
-
- if (!copy_spool_file(dst_file, src_file))
- {
- addr->transport_return = DEFER;
- addr->message = string_sprintf("%s transport creating file: "
- "%s failed with error: %s", tname, dstpath, strerror(errno));
- return FALSE;
- }
-
- if (!is_data_file)
- {
- (void)fclose(src_file);
- src_file = NULL;
- }
-
- (void)fclose(dst_file);
- dst_file = NULL;
-
- } /* end data copy */
+ if (s = dstpath, fchmod(dstfd, SPOOL_MODE) != 0)
+ op = US"setting perms on";
+ else
+ if (!copy_spool_file(dstfd, srcfd))
+ op = US"creating";
+ else
+ return TRUE;
+ }