From a109fa2d6dddfec7396a49d0e915befc1295399b Mon Sep 17 00:00:00 2001 From: Dylan Mikus Date: Wed, 2 Mar 2016 18:40:00 +0000 Subject: [PATCH] Change metadata file permissions and fix some warnings I changed metadata file permissions to 664. I made some non-void functions properly return non-void values. This does not change any functionality. Just quiets a few compiler warnings. --- daemon/recording.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/recording.c b/daemon/recording.c index 1a91ee46c..265f99fc7 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -116,6 +116,7 @@ int detect_setup_recording(struct call *call, str recordcall) { // We haven't set up the PCAP file, so set it up and write the URL to metadata init_write_pcap_file(call); } + return is_recording; } /** @@ -159,6 +160,7 @@ str *init_write_pcap_file(struct call *call) { // Write the location of the PCAP file to the metadata file fprintf(call->recording->meta_fp, "%s\n\n", pcap_path->s); } + return pcap_path; } /** @@ -186,6 +188,7 @@ str *meta_setup_file(struct recording *recording, str callid) { meta_filepath = str_init(meta_filepath, path_chars); recording->meta_filepath = meta_filepath; FILE *mfp = fopen(meta_filepath->s, "w"); + chmod(meta_filepath->s, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); if (mfp == NULL) { ilog(LOG_ERROR, "Could not open metadata file: %s", meta_filepath->s); free(recording->meta_filepath->s); @@ -208,7 +211,7 @@ ssize_t meta_write_sdp(FILE *meta_fp, struct iovec *sdp_iov, int iovcnt) { // descriptor does not. Make sure to flush any unwritten contents // so the file contents appear in order. fflush(meta_fp); - writev(meta_fd, sdp_iov, iovcnt); + return writev(meta_fd, sdp_iov, iovcnt); } /**