once again: (slightly) better output.
make maildir flag setting failure non-fatal. maildir sucks ...
This commit is contained in:
		
							parent
							
								
									a52fd7dde0
								
							
						
					
					
						commit
						e5894bdf04
					
				
					 2 changed files with 10 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -118,7 +118,7 @@ usage (int code)
 | 
			
		|||
    fputs (
 | 
			
		||||
PACKAGE " " VERSION " IMAP4 to maildir synchronizer\n"
 | 
			
		||||
"Copyright (C) 2000-2002 Michael R. Elkins <me@mutt.org>\n"
 | 
			
		||||
"Copyright (C) 2002-2003 Oswald Buddenhagen <ossi@users.sf.net>\n"
 | 
			
		||||
"Copyright (C) 2002-2004 Oswald Buddenhagen <ossi@users.sf.net>\n"
 | 
			
		||||
"usage:\n"
 | 
			
		||||
" " PACKAGE " [ flags ] mailbox [mailbox ...]\n"
 | 
			
		||||
" " PACKAGE " [ flags ] -a\n"
 | 
			
		||||
| 
						 | 
				
			
			@ -322,8 +322,8 @@ main (int argc, char **argv)
 | 
			
		|||
 | 
			
		||||
    if (!argv[optind] && !all)
 | 
			
		||||
    {
 | 
			
		||||
	fprintf (stderr, "No mailbox specified");
 | 
			
		||||
	usage (1);
 | 
			
		||||
	fprintf (stderr, "No mailbox specified. Try isync -h\n");
 | 
			
		||||
	return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    gethostname (Hostname, sizeof (Hostname));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										11
									
								
								src/sync.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/sync.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -155,6 +155,8 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
 | 
			
		|||
		fd = open (path, O_RDONLY);
 | 
			
		||||
		if (fd == -1)
 | 
			
		||||
		{
 | 
			
		||||
		    /* This can happen if the message was simply deleted (ok)
 | 
			
		||||
		       or the flags changed (not ok - maildir sucks). */
 | 
			
		||||
		    fprintf (stderr, "Error, unable to open %s: %s (errno %d)\n",
 | 
			
		||||
			    path, strerror (errno), errno);
 | 
			
		||||
		    continue;
 | 
			
		||||
| 
						 | 
				
			
			@ -247,8 +249,7 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
 | 
			
		|||
 | 
			
		||||
		    if (rename (path, newpath))
 | 
			
		||||
		    {
 | 
			
		||||
			    perror ("rename");
 | 
			
		||||
			    return -1;
 | 
			
		||||
			    perror ("Warning: cannot set flags on message");
 | 
			
		||||
		    }
 | 
			
		||||
		    else
 | 
			
		||||
		    {
 | 
			
		||||
| 
						 | 
				
			
			@ -264,9 +265,6 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
 | 
			
		|||
    if (upload)
 | 
			
		||||
	info (" %d messages.\n", upload);
 | 
			
		||||
 | 
			
		||||
    info ("Fetching new messages...");
 | 
			
		||||
    fflush (stdout);
 | 
			
		||||
 | 
			
		||||
    if (max_msgs == 0)
 | 
			
		||||
	max_msgs = UINT_MAX;
 | 
			
		||||
    else
 | 
			
		||||
| 
						 | 
				
			
			@ -351,6 +349,8 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
 | 
			
		|||
		continue;
 | 
			
		||||
 | 
			
		||||
	    /* give some visual feedback that something is happening */
 | 
			
		||||
	    if (!fetched)
 | 
			
		||||
		info ("Fetching new messages");
 | 
			
		||||
	    infoc ('.');
 | 
			
		||||
	    fflush (stdout);
 | 
			
		||||
	    fetched++;
 | 
			
		||||
| 
						 | 
				
			
			@ -390,6 +390,7 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
 | 
			
		|||
	}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (fetched)
 | 
			
		||||
	info (" %d messages\n", fetched);
 | 
			
		||||
 | 
			
		||||
    if (maildir_update_maxuid (mbox))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue