ctm_dequeue.c (16880) | ctm_dequeue.c (17131) |
---|---|
1/* 2 * Copyright (c) 1996, Gary J. Palmer 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 * --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/* 2 * Copyright (c) 1996, Gary J. Palmer 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 * --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $Id$ | 29 * $Id: ctm_dequeue.c,v 1.1 1996/07/01 20:53:55 gpalmer Exp $ |
30 */ 31 32/* 33 * Change this if you want to alter how many files it sends out by 34 * default 35 */ 36 37#define DEFAULT_NUM 2 --- 73 unchanged lines hidden (view full) --- 111 112#define ISFILE ((ftsent->fts_info & FTS_F) == FTS_F) 113#define IGNORE (ftsent->fts_name[0] == '.') 114#define HASNEXT (ftsent->fts_link != NULL) 115 116 while(((!ISFILE) || (IGNORE)) && (HASNEXT)) 117 ftsent = ftsent->fts_link; 118 | 30 */ 31 32/* 33 * Change this if you want to alter how many files it sends out by 34 * default 35 */ 36 37#define DEFAULT_NUM 2 --- 73 unchanged lines hidden (view full) --- 111 112#define ISFILE ((ftsent->fts_info & FTS_F) == FTS_F) 113#define IGNORE (ftsent->fts_name[0] == '.') 114#define HASNEXT (ftsent->fts_link != NULL) 115 116 while(((!ISFILE) || (IGNORE)) && (HASNEXT)) 117 ftsent = ftsent->fts_link; 118 |
119 if ((!ISFILE) || (IGNORE) || (!HASNEXT)) | 119 if ((!ISFILE) || (IGNORE)) |
120 { 121 err("No more chunks to mail"); 122 exit(0); 123 } 124 125#undef ISFILE 126#undef IGNORE 127#undef HASNEXT --- 26 unchanged lines hidden (view full) --- 154 exit(1); 155 } 156 157 if (!close_sendmail(sfp)) 158 exit(1); 159 160 munmap(buffer, ftsent->fts_statp->st_size); 161 close(fp); | 120 { 121 err("No more chunks to mail"); 122 exit(0); 123 } 124 125#undef ISFILE 126#undef IGNORE 127#undef HASNEXT --- 26 unchanged lines hidden (view full) --- 154 exit(1); 155 } 156 157 if (!close_sendmail(sfp)) 158 exit(1); 159 160 munmap(buffer, ftsent->fts_statp->st_size); 161 close(fp); |
162 163 if (unlink(filename) < 0) 164 { 165 err("unlink of `%s' failed", filename); 166 exit(1); 167 } |
|
162 163 err("sent file `%s'", ftsent->fts_name); 164 165 if (ftsent->fts_link != NULL) 166 ftsent = ftsent->fts_link; | 168 169 err("sent file `%s'", ftsent->fts_name); 170 171 if (ftsent->fts_link != NULL) 172 ftsent = ftsent->fts_link; |
173 else 174 break; |
|
167 } | 175 } |
176 |
|
168 err("exiting normally"); 169 return(0); 170} 171 172int 173fts_sort(const FTSENT ** a, const FTSENT ** b) 174{ 175 int a_info, b_info; --- 49 unchanged lines hidden --- | 177 err("exiting normally"); 178 return(0); 179} 180 181int 182fts_sort(const FTSENT ** a, const FTSENT ** b) 183{ 184 int a_info, b_info; --- 49 unchanged lines hidden --- |