| 808 | static int |
| 809 | chmetadata(FILE *stream) |
| 810 | { |
| 811 | if (output_owner != no_uid || output_group != no_gid) { |
| 812 | int r = fchown(fileno(stream), output_owner, output_group); |
| 813 | if (r < 0) |
| 814 | return r; |
| 815 | } |
| 816 | return output_mode == no_mode ? 0 : fchmod(fileno(stream), output_mode); |
| 817 | } |
| 818 | |
| 819 | /* Close STREAM. |
| 820 | If it had an I/O error, report it against DIR/NAME, |
| 821 | remove TEMPNAME if nonnull, and then exit. |
| 822 | If TEMPNAME is nonnull, and if requested, |