Lines Matching refs:dbname

3288 	char *dbname = NULL;  in apprentice_map()  local
3299 dbname = mkdbname(ms, fn, 0); in apprentice_map()
3300 if (dbname == NULL) in apprentice_map()
3303 if ((fd = open(dbname, O_RDONLY|O_BINARY)) == -1) in apprentice_map()
3307 file_error(ms, errno, "cannot stat `%s'", dbname); in apprentice_map()
3311 file_error(ms, 0, "file `%s' is too %s", dbname, in apprentice_map()
3321 file_error(ms, errno, "cannot map `%s'", dbname); in apprentice_map()
3338 if (check_buffer(ms, map, dbname) != 0) { in apprentice_map()
3343 file_error(ms, errno, "cannot mprotect `%s'", dbname); in apprentice_map()
3348 free(dbname); in apprentice_map()
3355 free(dbname); in apprentice_map()
3360 check_buffer(struct magic_set *ms, struct magic_map *map, const char *dbname) in check_buffer() argument
3370 file_error(ms, 0, "bad magic in `%s'", dbname); in check_buffer()
3383 VERSIONNO, dbname, version); in check_buffer()
3390 dbname, map->len, sizeof(struct magic)); in check_buffer()
3406 dbname, entries, nentries + 1); in check_buffer()
3425 char *dbname; in apprentice_compile() local
3433 dbname = mkdbname(ms, fn, 1); in apprentice_compile()
3435 if (dbname == NULL) in apprentice_compile()
3438 if ((fd = open(dbname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644)) == -1) in apprentice_compile()
3440 file_error(ms, errno, "cannot open `%s'", dbname); in apprentice_compile()
3449 file_error(ms, errno, "error writing `%s'", dbname); in apprentice_compile()
3456 file_error(ms, errno, "error writing `%s'", dbname); in apprentice_compile()
3467 free(dbname); in apprentice_compile()