// {
// char bf[256];
// snprintf(bf, sizeof(bf), "strlog-%i", getpid());
-// f = fopen(bf, "w");
+// f = fopen(bf, "wb");
// }
hash_num = _evas_stringshare_hash_gen(str, &slen);
for (el = share.buckets[hash_num]; el; pel = el, el = el->next)
static Eina_Bool
_open_file_descriptors(const char *source, const char *header)
{
- header_fd = fopen(header, "w");
+ header_fd = fopen(header, "wb");
if (!header_fd)
return EINA_FALSE;
- source_fd = fopen(source, "w");
+ source_fd = fopen(source, "wb");
if (!source_fd)
goto err;
FILE *f = NULL;
if (!options.watchfile) return;
- f = fopen(options.watchfile, "a");
+ f = fopen(options.watchfile, "ab");
if (!f) return;
if (annotate)
{
char print_deps_missing_files;
- /* If true, fopen (deps_file, "a") else fopen (deps_file, "w"). */
+ /* If true, fopen (deps_file, "ab") else fopen (deps_file, "wb"). */
char print_deps_append;
/* Nonzero means print names of header files (-H). */
if (!opts->out_fname || !strcmp(opts->out_fname, ""))
opts->out_fname = "stdout";
- else if (!freopen(opts->out_fname, "w", stdout))
+ else if (!freopen(opts->out_fname, "wb", stdout))
cpp_pfatal_with_name(&parse_in, opts->out_fname);
for (i = 0;; i++)
c2->evlog_fetch_timer = ecore_timer_add(0.2, _cb_evlog, c2);
snprintf(buf, sizeof(buf), "%s/efl_debug_evlog-%ld.log",
getenv("HOME"), (long)c2->pid);
- c2->evlog_file = fopen(buf, "w");
+ c2->evlog_file = fopen(buf, "wb");
}
}
}
EINA_SAFETY_ON_NULL_RETURN_VAL(filename, EINA_FALSE);
- f = fopen(filename, "r");
+ f = fopen(filename, "rb");
// Now that we have used filename, we must free its memory holder:
eina_value_flush(&val);
char tmp[1024];
snprintf(tmp, sizeof(tmp), "ecore_mem_stat.%i", getpid());
- _ecore_memory_statistic_file = fopen(tmp, "w");
+ _ecore_memory_statistic_file = fopen(tmp, "wb");
#endif
_ecore_memory_pid = getpid();
ecore_animator_add(_ecore_memory_statistic, NULL);
FILE *fp = NULL;
EVP_PKEY *privkey = NULL;
- if (!(fp = fopen(key_file, "r")))
+ if (!(fp = fopen(key_file, "rb")))
goto error;
SSL_ERROR_CHECK_GOTO_ERROR(!(privkey = PEM_read_PrivateKey(fp, NULL, NULL, NULL)));
FILE *fp = NULL;
X509 *cert = NULL;
- if (!(fp = fopen(cert_file, "r")))
+ if (!(fp = fopen(cert_file, "rb")))
goto error;
SSL_ERROR_CHECK_GOTO_ERROR(!(cert = PEM_read_X509(fp, NULL, NULL, NULL)));
if (stat("/sys/module/vboxvideo", &st) == 0)
{
/*
- FILE *fp = fopen("/sys/module/vboxvideo/version", "r");
+ FILE *fp = fopen("/sys/module/vboxvideo/version", "rb");
if (fp)
{
if (fgets(buf, sizeof(buf), fp))
// only do this on new kernels = let's say 3.14 and up. 3.16 definitely
// works
{
- FILE *fp = fopen("/proc/sys/kernel/osrelease", "r");
+ FILE *fp = fopen("/proc/sys/kernel/osrelease", "rb");
if (fp)
{
if (fgets(buf, sizeof(buf), fp))
* int len;
* void *data;
*
- * f = fopen(file, "r");
+ * f = fopen(file, "rb");
* fseek(f, 0, SEEK_END);
* len = ftell(f);
* rewind(f);
* int len;
* void *data;
*
- * f = fopen(file, "r");
+ * f = fopen(file, "rb");
* fseek(f, 0, SEEK_END);
* len = ftell(f);
* rewind(f);
if (!emile_cipher_init()) return NULL;
/* Load the X509 certificate in memory. */
- fp = fopen(certificate_file, "r");
+ fp = fopen(certificate_file, "rb");
if (!fp)
return NULL;
goto on_error;
/* Load the private key in memory. */
- fp = fopen(private_key_file, "r");
+ fp = fopen(private_key_file, "rb");
if (!fp)
goto on_error;
EINA_SAFETY_ON_NULL_RETURN_VAL(menu, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(path, 0);
- f = fopen(path, "w");
+ f = fopen(path, "wb");
if (!f) return 0;
fprintf(f, "<?xml version=\"1.0\"?>\n");
fprintf(f, "<!DOCTYPE Menu PUBLIC \"-//freedesktop//DTD Menu 1.0//EN\" "
if (ecore_file_can_exec(file))
return _mime_application_x_executable;
- if (!(f = fopen(file, "r"))) return NULL;
+ if (!(f = fopen(file, "rb"))) return NULL;
i = fread(buf, 1, sizeof(buf), f);
fclose(f);
/* create info file */
snprintf(dest, sizeof(dest), "%s/info/%s.trashinfo", trash_dir, fname);
- if ((f = fopen(dest, "w")))
+ if ((f = fopen(dest, "wb")))
{
fputs("[Trash Info]\n", f);
bench->name,
bench->run);
- main_script = fopen(buffer, "w");
+ main_script = fopen(buffer, "wb");
if (!main_script)
return NULL;
bench->run,
run->name);
- current_data = fopen(buffer, "w");
+ current_data = fopen(buffer, "wb");
if (!current_data)
continue;
if (fname)
{
/* check if there is a file of that name */
- FILE *f = fopen(fname, "r");
+ FILE *f = fopen(fname, "rb");
if (f)
{
fclose(f);
char pbuf[PATH_MAX];
const char *arg = NULL;
- FILE *testf = fopen(fname, "r");
+ FILE *testf = fopen(fname, "rb");
if (!testf)
return NULL;
#ifdef STDOUT_DBG
dbf = stdout;
#else
- dbf = fopen("EVAS-RENDER-DEBUG.log", "w");
+ dbf = fopen("EVAS-RENDER-DEBUG.log", "wb");
#endif
if (!dbf) return;
}
int num;
num = 0;
- f = fopen("/etc/fb.modes","r");
+ f = fopen("/etc/fb.modes","rb");
if (!f)
{
*num_return = 0;
// header[7]: options (unused)
header[7] = 0;
- f = fopen(file, "w");
+ f = fopen(file, "wb");
if (!f) return 0;
// Write header
// Note: consider extending the header instead of filling all the bits here
header[7] = 0;
- f = fopen(file, "w");
+ f = fopen(file, "wb");
if (!f) return 0;
// Write header
evas_model_save_data_from_mesh(pd, f, header, &data);
- FILE * _obj_file = fopen(_obj_file_name, "w+");
+ FILE * _obj_file = fopen(_obj_file_name, "wb+");
if (!_obj_file)
{
ERR("File open '%s' for save failed", _obj_file_name);
const char *_mtl_file_name,
Evas_Canvas3D_Material_Data *mat)
{
- FILE * _mtl_file = fopen(_mtl_file_name, "w+");
+ FILE * _mtl_file = fopen(_mtl_file_name, "wb+");
if (!_mtl_file)
{
ERR("File open '%s' for save failed", _mtl_file_name);
if (!evas_model_save_header_from_mesh(pd, f, &header)) return;
evas_model_save_data_from_mesh(pd, f, header, &data);
- FILE *_ply_file = fopen(file, "w+");
+ FILE *_ply_file = fopen(file, "wb+");
if (!_ply_file)
{
ERR("File open '%s' for save failed", file);
FILE *fp;
int error;
- if (!(fp = fopen(path, "r")))
+ if (!(fp = fopen(path, "rb")))
return dns_syerr();
error = dns_hosts_loadfile(hosts, fp);
FILE *fp;
int error;
- if (!(fp = fopen(path, "r")))
+ if (!(fp = fopen(path, "rb")))
return dns_syerr();
error = dns_resconf_loadfile(resconf, fp);
FILE *fp;
int error;
- if (!(fp = fopen(path, "r")))
+ if (!(fp = fopen(path, "rb")))
return dns_syerr();
error = dns_nssconf_loadfile(resconf, fp);
}
char* filename = argv[2];
- FILE* file = fopen(filename, "r");
+ FILE* file = fopen(filename, "rb");
if (file == NULL) {
perror("fopen");
return EXIT_FAILURE;
void
_writeToFile(const char *filePath, char *text)
{
- FILE *f = fopen(filePath, "r+");
+ FILE *f = fopen(filePath, "rb+");
if (f == NULL)
- f = fopen(filePath, "w");
+ f = fopen(filePath, "wb");
fail_if(f == NULL);
fprintf(f, "%s\n", text);
fclose(f);
fail_if(-1 == (fd = mkstemp(file)));
fail_if(!!close(fd));
- fail_if(!(noread = fopen("/dev/null", "w")));
+ fail_if(!(noread = fopen("/dev/null", "wb")));
/* Sign an eet file. */
ef = eet_open(file, EET_FILE_MODE_WRITE);
static Eina_Bool _create_file(void *data)
{
- FILE *fd = fopen((const char*)data, "w+");
+ FILE *fd = fopen((const char*)data, "wb+");
ck_assert_ptr_ne(fd, NULL);
fprintf(fd, "test test");
fclose(fd);
static Eina_Bool _modify_file(void *data)
{
- FILE *fd = fopen((const char*)data, "a");
+ FILE *fd = fopen((const char*)data, "ab");
ck_assert_ptr_ne(fd, NULL);
fprintf(fd, "appened");
fclose(fd);
fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit));
fail_if(quit != 1);
- f = fopen(buf, "w");
+ f = fopen(buf, "wb");
fail_if(!f);
fprintf(f, "return false");
fclose(f);
for (l = 1; l < argc; l++)
{
- if (!(fptr = fopen(argv[l], "r")))
+ if (!(fptr = fopen(argv[l], "rb")))
{
fprintf(stderr, "Could not open %s\n", argv[l]);
continue;