aboutsummaryrefslogtreecommitdiffstats
path: root/libical/src/test/copycluster.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-04-18 01:54:48 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-04-18 01:54:48 +0800
commite6f1da7f4681def1f8b0472a504dda549f9f4b89 (patch)
tree20975542002d583663c5c728e9f3cde0bd61573f /libical/src/test/copycluster.c
parent3a49d3e43d8e752162e5c4a098e1c0991a7611db (diff)
downloadgsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar.gz
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar.bz2
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar.lz
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar.xz
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.tar.zst
gsoc2013-evolution-e6f1da7f4681def1f8b0472a504dda549f9f4b89.zip
Finish merge of new libical 0.23a version
2001-04-17 JP Rosevear <jpr@ximian.com> * Finish merge of new libical 0.23a version svn path=/trunk/; revision=9420
Diffstat (limited to 'libical/src/test/copycluster.c')
-rw-r--r--libical/src/test/copycluster.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libical/src/test/copycluster.c b/libical/src/test/copycluster.c
index fa87e25385..4eefc37758 100644
--- a/libical/src/test/copycluster.c
+++ b/libical/src/test/copycluster.c
@@ -31,8 +31,14 @@
#include "icalfileset.h"
#include <errno.h>
#include <string.h> /* For strerror */
+#include <signal.h> /* for signal */
+#include <unistd.h> /* for alarm */
#include "icalrestriction.h"
+static void sig_alrm(int i){
+ fprintf(stderr,"Could not get lock on file\n");
+ exit(1);
+}
/* This program copies a file that holds iCal components to an other file. */
@@ -57,10 +63,14 @@ int main(int c, char *argv[]){
}
- icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR, ICAL_ERROR_NONFATAL);
icalerror_set_error_state(ICAL_PARSE_ERROR, ICAL_ERROR_NONFATAL);
+
+ signal(SIGALRM,sig_alrm);
+
+ alarm(0);
clusterin = icalfileset_new(argv[1]);
+ alarm(0);
if (clusterin == 0){
printf("Could not open input cluster \"%s\"",argv[1]);
@@ -81,13 +91,16 @@ int main(int c, char *argv[]){
itr != 0;
itr = icalset_get_next_component(clusterin)){
+ icalerror_set_error_state(ICAL_BADARG_ERROR, ICAL_ERROR_NONFATAL);
icalrestriction_check(itr);
+ icalerror_set_error_state(ICAL_BADARG_ERROR, ICAL_ERROR_DEFAULT);
if (itr != 0){
if(tostdout){
printf("--------------\n%s\n",icalcomponent_as_ical_string(itr));
+
} else {
icalfileset_add_component(clusterout,