quotafile.c (0bfd163f522701b486e066fa2e56624c02f5081a) | quotafile.c (4238b561f0963de9832b49a8365897c08b994e79) |
---|---|
1/*- 2 * Copyright (c) 2008 Dag-Erling Coïdan Smørgrav 3 * Copyright (c) 2008 Marshall Kirk McKusick 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 110 unchanged lines hidden (view full) --- 119 int qcmd, serrno; 120 121 if (strcmp(fs->fs_vfstype, "ufs")) 122 return (NULL); 123 if ((qf = calloc(1, sizeof(*qf))) == NULL) 124 return (NULL); 125 qf->fd = -1; 126 qf->quotatype = quotatype; | 1/*- 2 * Copyright (c) 2008 Dag-Erling Coïdan Smørgrav 3 * Copyright (c) 2008 Marshall Kirk McKusick 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 110 unchanged lines hidden (view full) --- 119 int qcmd, serrno; 120 121 if (strcmp(fs->fs_vfstype, "ufs")) 122 return (NULL); 123 if ((qf = calloc(1, sizeof(*qf))) == NULL) 124 return (NULL); 125 qf->fd = -1; 126 qf->quotatype = quotatype; |
127 strncpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); | 127 strlcpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); |
128 if (stat(qf->fsname, &st) != 0) 129 goto error; 130 qf->dev = st.st_dev; 131 serrno = hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname)); 132 qcmd = QCMD(Q_GETQUOTASIZE, quotatype); 133 if (quotactl(qf->fsname, qcmd, 0, &qf->wordsize) == 0) 134 return (qf); 135 if (serrno == 0) { --- 460 unchanged lines hidden --- | 128 if (stat(qf->fsname, &st) != 0) 129 goto error; 130 qf->dev = st.st_dev; 131 serrno = hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname)); 132 qcmd = QCMD(Q_GETQUOTASIZE, quotatype); 133 if (quotactl(qf->fsname, qcmd, 0, &qf->wordsize) == 0) 134 return (qf); 135 if (serrno == 0) { --- 460 unchanged lines hidden --- |