Skip to content

Commit

Permalink
A8 Final
Browse files Browse the repository at this point in the history
  • Loading branch information
stamrakar authored and stamrakar committed Oct 28, 2024
1 parent e0fd834 commit f072573
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/aesdsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ void *threadfunc(void *args)
syslog(LOG_DEBUG, "PACKET SUCCESSFULLY VALIDATED");

#if (USE_AESD_CHAR_DEVICE == 1)
recvfile_fd = open(recvfile, O_RDWR | O_CREAT | O_TRUNC, S_IRWXU | S_IRGRP | S_IROTH);
recvfile_fd = open(recvfile, O_RDWR | O_CREAT | O_APPEND, 0644);
if (recvfile_fd == -1)
{
/*error*/
Expand All @@ -407,7 +407,7 @@ void *threadfunc(void *args)
perror("pthread mutex_lock failed");
}

//lseek(recvfile_fd, 0, SEEK_END);
lseek(recvfile_fd, 0, SEEK_END);

nr = write(recvfile_fd, my_buffer, supplementBuf);

Expand Down Expand Up @@ -459,7 +459,7 @@ void *threadfunc(void *args)
closeAll(EXIT_FAILURE);
}
#else
recvfile_fd = open(recvfile, O_RDWR | O_CREAT | O_TRUNC, S_IRWXU | S_IRGRP | S_IROTH);
recvfile_fd = open(recvfile, O_RDWR | O_CREAT | O_APPEND, 0644);
if (recvfile_fd == -1)
{
/*error*/
Expand All @@ -482,8 +482,7 @@ void *threadfunc(void *args)
perror("pthread mutex_lock failed");
}




send_my_buffer = (char *) malloc(BUF_SIZE);
if (send_my_buffer == NULL)
{
Expand Down

0 comments on commit f072573

Please sign in to comment.