Home
last modified time | relevance | path

Searched refs:fp (Results 1 – 25 of 26) sorted by relevance

12

/redis-3.2.3/src/
H A Dredis-check-aof.c58 epos = ftello(fp); in readLong()
72 epos = ftello(fp); in readBytes()
73 real = fread(target,1,length,fp); in readBytes()
84 if (!readLong(fp,'$',&len)) { in readString()
91 if (!readBytes(fp,*target,len)) { in readString()
102 return readLong(fp,'*',target); in readArgc()
105 off_t process(FILE *fp) { in process() argument
170 FILE *fp = fopen(filename,"r+"); in main() local
171 if (fp == NULL) { in main()
188 off_t pos = process(fp); in main()
[all …]
H A Ddebugmacro.h36 FILE *fp = fopen("/tmp/log.txt","a"); \
37 fprintf(fp,"%s:%s:%d:\t", __FILE__, __FUNCTION__, __LINE__); \
38 fprintf(fp,__VA_ARGS__); \
39 fprintf(fp,"\n"); \
40 fclose(fp); \
H A Drio.c112 retval = fwrite(buf,len,1,r->io.file.fp); in rioFileWrite()
118 fflush(r->io.file.fp); in rioFileWrite()
119 aof_fsync(fileno(r->io.file.fp)); in rioFileWrite()
127 return fread(buf,len,1,r->io.file.fp); in rioFileRead()
132 return ftello(r->io.file.fp); in rioFileTell()
138 return (fflush(r->io.file.fp) == 0) ? 1 : 0; in rioFileFlush()
153 void rioInitWithFile(rio *r, FILE *fp) { in rioInitWithFile() argument
155 r->io.file.fp = fp; in rioInitWithFile()
H A Daof.c621 if (fp && redis_fstat(fileno(fp),&sb) != -1 && sb.st_size == 0) { in loadAppendOnlyFile()
623 fclose(fp); in loadAppendOnlyFile()
627 if (fp == NULL) { in loadAppendOnlyFile()
637 startLoading(fp); in loadAppendOnlyFile()
654 if (feof(fp)) in loadAppendOnlyFile()
717 fclose(fp); in loadAppendOnlyFile()
726 if (!feof(fp)) { in loadAppendOnlyFile()
1019 FILE *fp; in rewriteAppendOnlyFile() local
1030 if (!fp) { in rewriteAppendOnlyFile()
1046 fclose(fp); in rewriteAppendOnlyFile()
[all …]
H A Dredis-check-rdb.c181 FILE *fp; in redis_check_rdb() local
184 if ((fp = fopen(rdbfilename,"r")) == NULL) return C_ERR; in redis_check_rdb()
186 rioInitWithFile(&rdb,fp); in redis_check_rdb()
201 startLoading(fp); in redis_check_rdb()
312 fclose(fp); in redis_check_rdb()
H A Dsds.h134 unsigned char *fp = ((unsigned char*)s)-1; in sdssetlen() local
135 *fp = SDS_TYPE_5 | (newlen << SDS_TYPE_BITS); in sdssetlen()
158 unsigned char *fp = ((unsigned char*)s)-1; in sdsinclen() local
160 *fp = SDS_TYPE_5 | (newlen << SDS_TYPE_BITS); in sdsinclen()
H A Drdb.c862 FILE *fp; in rdbSave() local
867 fp = fopen(tmpfile,"w"); in rdbSave()
868 if (!fp) { in rdbSave()
879 rioInitWithFile(&rdb,fp); in rdbSave()
913 fclose(fp); in rdbSave()
1230 void startLoading(FILE *fp) { in startLoading() argument
1281 FILE *fp; in rdbLoad() local
1292 fclose(fp); in rdbLoad()
1299 fclose(fp); in rdbLoad()
1305 startLoading(fp); in rdbLoad()
[all …]
H A Dzmalloc.c341 FILE *fp = fopen("/proc/self/smaps","r"); in zmalloc_get_smap_bytes_by_field() local
344 if (!fp) return 0; in zmalloc_get_smap_bytes_by_field()
345 while(fgets(line,sizeof(line),fp) != NULL) { in zmalloc_get_smap_bytes_by_field()
354 fclose(fp); in zmalloc_get_smap_bytes_by_field()
H A Drio.h72 FILE *fp; member
127 void rioInitWithFile(rio *r, FILE *fp);
H A Dsds.c89 unsigned char *fp; /* flags pointer. */ in sdsnewlen() local
96 fp = ((unsigned char*)s)-1; in sdsnewlen()
99 *fp = type | (initlen << SDS_TYPE_BITS); in sdsnewlen()
106 *fp = type; in sdsnewlen()
113 *fp = type; in sdsnewlen()
120 *fp = type; in sdsnewlen()
127 *fp = type; in sdsnewlen()
317 unsigned char *fp = ((unsigned char*)s)-1; in sdsIncrLen() local
320 *fp = SDS_TYPE_5 | ((oldlen+incr) << SDS_TYPE_BITS); in sdsIncrLen()
H A Dlatency.c67 FILE *fp = fopen("/sys/kernel/mm/transparent_hugepage/enabled","r"); in THPIsEnabled() local
68 if (!fp) return 0; in THPIsEnabled()
69 if (fgets(buf,sizeof(buf),fp) == NULL) { in THPIsEnabled()
70 fclose(fp); in THPIsEnabled()
73 fclose(fp); in THPIsEnabled()
H A Dutil.c470 FILE *fp = fopen("/dev/urandom","r"); in getRandomHexChars() local
471 if (fp && fread(seed,sizeof(seed),1,fp) == 1) in getRandomHexChars()
473 if (fp) fclose(fp); in getRandomHexChars()
H A Dserver.c309 FILE *fp; in serverLogRaw() local
318 if (!fp) return; in serverLogRaw()
321 fprintf(fp,"%s",msg); in serverLogRaw()
341 fflush(fp); in serverLogRaw()
1742 if (!fp) return; in checkTcpBacklogSettings()
1749 fclose(fp); in checkTcpBacklogSettings()
3620 if (!fp) return -1; in linuxOvercommitMemoryValue()
3622 fclose(fp); in linuxOvercommitMemoryValue()
3625 fclose(fp); in linuxOvercommitMemoryValue()
3647 if (fp) { in createPidFile()
[all …]
H A Dconfig.c659 FILE *fp; in loadServerConfig() local
662 fp = stdin; in loadServerConfig()
664 if ((fp = fopen(filename,"r")) == NULL) { in loadServerConfig()
670 while(fgets(buf,CONFIG_MAX_LINE+1,fp) != NULL) in loadServerConfig()
672 if (fp != stdin) fclose(fp); in loadServerConfig()
1325 FILE *fp = fopen(path,"r"); local
1330 if (fp == NULL && errno != ENOENT) return NULL;
1337 if (fp == NULL) return state;
1340 while(fgets(buf,CONFIG_MAX_LINE+1,fp) != NULL) {
1377 fclose(fp);
H A Ddebug.c914 FILE *fp; in memtest_test_linux_anonymous_maps() local
925 fp = fopen("/proc/self/maps","r"); in memtest_test_linux_anonymous_maps()
926 if (!fp) return 0; in memtest_test_linux_anonymous_maps()
927 while(fgets(line,sizeof(line),fp) != NULL) { in memtest_test_linux_anonymous_maps()
969 fclose(fp); in memtest_test_linux_anonymous_maps()
H A Dredis-cli.c1246 FILE *fp = fopen(rcfile,"r"); in cliLoadPreferences() local
1249 if (fp) { in cliLoadPreferences()
1250 while(fgets(buf,sizeof(buf),fp) != NULL) { in cliLoadPreferences()
1376 FILE *fp; in evalMode() local
1399 fp = fopen(config.eval,"r"); in evalMode()
1400 if (!fp) { in evalMode()
1405 while((nread = fread(buf,1,sizeof(buf),fp)) != 0) { in evalMode()
1408 fclose(fp); in evalMode()
H A Dcluster.c91 FILE *fp = fopen(filename,"r"); in clusterLoadConfig() local
96 if (fp == NULL) { in clusterLoadConfig()
109 if (fstat(fileno(fp),&sb) != -1 && sb.st_size == 0) { in clusterLoadConfig()
110 fclose(fp); in clusterLoadConfig()
123 while(fgets(line,maxline,fp) != NULL) { in clusterLoadConfig()
265 fclose(fp); in clusterLoadConfig()
281 if (fp) fclose(fp); in clusterLoadConfig()
/redis-3.2.3/tests/integration/
H A Daof.tcl6 upvar fp fp
7 puts -nonewline $fp $str
11 upvar fp fp aof_path aof_path
12 set fp [open $aof_path w+]
14 close $fp
H A Dreplication.tcl2 set fp [open $log r]
3 set content [read $fp]
4 close $fp
/redis-3.2.3/tests/support/
H A Dserver.tcl204 set fp [open $config_file w+]
206 puts -nonewline $fp "$directive "
207 puts $fp [dict get $config $directive]
209 close $fp
/redis-3.2.3/deps/hiredis/
H A Dsds.h134 unsigned char *fp = ((unsigned char*)s)-1; in sdssetlen() local
135 *fp = SDS_TYPE_5 | (newlen << SDS_TYPE_BITS); in sdssetlen()
158 unsigned char *fp = ((unsigned char*)s)-1; in sdsinclen() local
160 *fp = SDS_TYPE_5 | (newlen << SDS_TYPE_BITS); in sdsinclen()
H A Dsds.c89 unsigned char *fp; /* flags pointer. */ in sdsnewlen() local
96 fp = ((unsigned char*)s)-1; in sdsnewlen()
99 *fp = type | (initlen << SDS_TYPE_BITS); in sdsnewlen()
106 *fp = type; in sdsnewlen()
113 *fp = type; in sdsnewlen()
120 *fp = type; in sdsnewlen()
127 *fp = type; in sdsnewlen()
317 unsigned char *fp = ((unsigned char*)s)-1; in sdsIncrLen() local
320 *fp = SDS_TYPE_5 | ((oldlen+incr) << SDS_TYPE_BITS); in sdsIncrLen()
/redis-3.2.3/deps/linenoise/
H A Dlinenoise.c1165 FILE *fp; in linenoiseHistorySave() local
1168 fp = fopen(filename,"w"); in linenoiseHistorySave()
1170 if (fp == NULL) return -1; in linenoiseHistorySave()
1173 fprintf(fp,"%s\n",history[j]); in linenoiseHistorySave()
1174 fclose(fp); in linenoiseHistorySave()
1184 FILE *fp = fopen(filename,"r"); in linenoiseHistoryLoad() local
1187 if (fp == NULL) return -1; in linenoiseHistoryLoad()
1189 while (fgets(buf,LINENOISE_MAX_LINE,fp) != NULL) { in linenoiseHistoryLoad()
1197 fclose(fp); in linenoiseHistoryLoad()
/redis-3.2.3/deps/lua/src/
H A Dlmathlib.c98 double fp = modf(luaL_checknumber(L, 1), &ip); in math_modf() local
100 lua_pushnumber(L, fp); in math_modf()
H A Dldebug.c114 Proto *fp = getluaproto(ci); in findlocal() local
115 if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL) in findlocal()

12