aboutsummaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c
index e41709d..200d987 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6,49 +6,49 @@
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
Wydawca is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with wydawca. If not, see <http://www.gnu.org/licenses/>. */
#include "wydawca.h"
struct spool_list
{
struct spool_list *next;
struct spool spool;
};
static struct spool_list *spool_list;
void
register_spool (struct spool *spool)
{
- struct spool_list *sp = xmalloc (sizeof *sp);
+ struct spool_list *sp = grecs_malloc (sizeof *sp);
sp->spool = *spool;
sp->next = spool_list;
spool_list = sp;
}
static int
spool_check_alias (struct spool *spool, const char *name)
{
if (spool->aliases && grecs_list_locate (spool->aliases, (char*) name))
return 1;
return 0;
}
struct spool *
wydawca_find_spool (const char *name)
{
struct spool_list *sp;
for (sp = spool_list; sp; sp = sp->next)
{
if (strcmp (sp->spool.tag, name) == 0
|| spool_check_alias (&sp->spool, name))
return &sp->spool;
}
@@ -92,49 +92,49 @@ file_type_str (enum file_type type)
/* Parse file NAME: determine its type and root name and store this
information in FINFO */
void
parse_file_name (const char *name, struct file_info *finfo)
{
static struct suffix
{
const char *suf;
unsigned len;
enum file_type type;
} suftab[] = {
{ SUF_SIG, SUF_SIG_LEN, file_signature },
{ SUF_DIR, SUF_DIR_LEN, file_directive },
{ "", 0, file_dist }
};
int i;
unsigned len = strlen (name);
for (i = 0; i < sizeof suftab / sizeof suftab[0]; i++)
{
if (len >= suftab[i].len
&& memcmp (name + len - suftab[i].len,
suftab[i].suf, suftab[i].len) == 0)
{
- finfo->name = xstrdup (name);
+ finfo->name = grecs_strdup (name);
finfo->type = suftab[i].type;
finfo->root_len = len - suftab[i].len;
return;
}
}
abort (); /* should not happen */
}
int
match_uid_p (uid_t uid, int uc, uid_t *uv)
{
int i;
if (!uv)
return 1;
for (i = 0; i < uc; i++)
if (uv[i] == uid)
return 1;
return 0;
}
/* Scan upload directory from the DPAIR and register all files found
there, forming triplets when possible */
void
scan_spool_unlocked (const struct spool *spool, int uc, uid_t *uv)

Return to:

Send suggestions and report system problems to the System administrator.