Move variable declarations to while loop
Change watchpath to #define
printdird: free dest
style