fifolog_create.c (6e482ac5ad6f83bbf59ffd34bfbfdd044477c577) fifolog_create.c (818bc4157a6c19bf3a858a8322bbd37dbc19ceb1)
1/*-
2 * Copyright (c) 2005-2008 Poul-Henning Kamp
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 30 unchanged lines hidden (view full) ---

39
40#include "fifolog.h"
41#include "libfifolog.h"
42
43const char *
44fifolog_create(const char *fn, off_t size, ssize_t recsize)
45{
46 int i, fd;
1/*-
2 * Copyright (c) 2005-2008 Poul-Henning Kamp
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 30 unchanged lines hidden (view full) ---

39
40#include "fifolog.h"
41#include "libfifolog.h"
42
43const char *
44fifolog_create(const char *fn, off_t size, ssize_t recsize)
45{
46 int i, fd;
47 unsigned u;
47 ssize_t u;
48 off_t ms;
49 struct stat st;
50 char *buf;
51 int created;
52
53 fd = open(fn, O_WRONLY | O_TRUNC | O_EXCL | O_CREAT, 0644);
54 if (fd < 0) {
55 created = 0;

--- 67 unchanged lines hidden ---
48 off_t ms;
49 struct stat st;
50 char *buf;
51 int created;
52
53 fd = open(fn, O_WRONLY | O_TRUNC | O_EXCL | O_CREAT, 0644);
54 if (fd < 0) {
55 created = 0;

--- 67 unchanged lines hidden ---