Lines Matching defs:fp
188 FILE *fp = fopen(path, mode);
189 return fp;
193 static void check_and_fclose(FILE *fp, const char *name) {
194 fflush(fp);
195 if (ferror(fp)) LOGE("Error in %s\n(%s)\n", name, strerror(errno));
196 fclose(fp);
328 FILE *fp = fopen_path(COMMAND_FILE, "r");
329 if (fp != NULL) {
337 if (!fgets(buf, sizeof(buf), fp)) break;
346 check_and_fclose(fp, COMMAND_FILE);
502 FILE *fp = fopen_path(INTENT_FILE, "w");
503 if (fp == NULL) {
506 fputs(send_intent, fp);
507 check_and_fclose(fp, INTENT_FILE);
519 FILE* fp = fopen_path(LOCALE_FILE, "w");
520 fwrite(locale, 1, len, fp);
521 fflush(fp);
522 fsync(fileno(fp));
523 check_and_fclose(fp, LOCALE_FILE);
1140 FILE* fp = fopen_path(LOCALE_FILE, "r");
1142 if (fp != NULL) {
1143 fgets(buffer, sizeof(buffer), fp);
1153 check_and_fclose(fp, LOCALE_FILE);