HotFix do not set file permissions on UT assert outputs
File permissions in general are a POSIX concept, but this tool should be
pure C99.  It should not rely on any POSIX headers or POSIX-specific
API calls.
#include <errno.h>
#include <string.h>
#include <ctype.h>
-#include <sys/stat.h>
#include "common_types.h"
#include "utassert.h"
@@ -55,17 +54,9 @@ typedef struct
bool UtMem2BinFile(const void *Memory, const char *Filename, uint32 Length)
{
FILE *fp;
- int fd;
- struct stat dststat;
if ((fp = fopen(Filename, "w")))
{
- fd = fileno(fp);
- if (fstat(fd, &dststat) == 0)
- {
- fchmod(fd, dststat.st_mode & ~(S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH));
- }
-
fwrite(Memory, Length, 1, fp);
fclose(fp);
return true;
@@ -105,17 +96,9 @@ bool UtMem2HexFile(const void *Memory, const char *Filename, uint32 Length)
FILE * fp;
uint32 i;
uint32 j;
- int fd;
- struct stat dststat;
if ((fp = fopen(Filename, "w")))
{
- fd = fileno(fp);
- if (fstat(fd, &dststat) == 0)
- {
- fchmod(fd, dststat.st_mode & ~(S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH));
- }
-
for (i = 0; i < Length; i += 16)
{
fprintf(fp, " %06lX: ", (unsigned long)i);
